add backup_count in sample
This commit is contained in:
@@ -27,12 +27,14 @@ pub const DOT_OSS_BACKUPD_CONFIG: &str = ".oss-backupd-config.json";
|
||||
},
|
||||
"host": "",
|
||||
"encrypt_pubkey_file": "",
|
||||
"backup_count": 10,
|
||||
"items": [
|
||||
{
|
||||
"oss_config": null, // OPT @oss_config
|
||||
"target": "",
|
||||
"file_name": "",
|
||||
"encrypt_pubkey_file": null // OPT @encrypt_pubkey_file
|
||||
"encrypt_pubkey_file": null, // OPT @encrypt_pubkey_file
|
||||
"backup_count": 8
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -72,10 +72,7 @@ pub fn zip_file(target: &str, zip_file: &str) -> XResult<()> {
|
||||
|
||||
pub fn get_file_name(path: &Path) -> String {
|
||||
match path.file_name() {
|
||||
None => "no_file_name".to_string(),
|
||||
Some(f) => match f.to_os_string().into_string().ok() {
|
||||
None => "unknown_file_name".to_string(),
|
||||
Some(f) => f,
|
||||
},
|
||||
None => "no_file_name".to_owned(),
|
||||
Some(f) => f.to_os_string().into_string().unwrap_or("unknown_file_name".to_owned()),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user