add backup_count in sample

This commit is contained in:
2020-04-04 21:49:54 +08:00
parent ee2156a2ca
commit a8bb406fde
2 changed files with 5 additions and 6 deletions

View File

@@ -27,12 +27,14 @@ pub const DOT_OSS_BACKUPD_CONFIG: &str = ".oss-backupd-config.json";
}, },
"host": "", "host": "",
"encrypt_pubkey_file": "", "encrypt_pubkey_file": "",
"backup_count": 10,
"items": [ "items": [
{ {
"oss_config": null, // OPT @oss_config "oss_config": null, // OPT @oss_config
"target": "", "target": "",
"file_name": "", "file_name": "",
"encrypt_pubkey_file": null // OPT @encrypt_pubkey_file "encrypt_pubkey_file": null, // OPT @encrypt_pubkey_file
"backup_count": 8
} }
] ]
} }

View File

@@ -72,10 +72,7 @@ pub fn zip_file(target: &str, zip_file: &str) -> XResult<()> {
pub fn get_file_name(path: &Path) -> String { pub fn get_file_name(path: &Path) -> String {
match path.file_name() { match path.file_name() {
None => "no_file_name".to_string(), None => "no_file_name".to_owned(),
Some(f) => match f.to_os_string().into_string().ok() { Some(f) => f.to_os_string().into_string().unwrap_or("unknown_file_name".to_owned()),
None => "unknown_file_name".to_string(),
Some(f) => f,
},
} }
} }