Merge pull request 'Quick fix for deleting old backups' (#3) from backup_delete_fix into master
Reviewed-on: https://git.etztech.xyz/ZeroHD/Albatross/pulls/3backup_error_fix
commit
b9aad433ba
|
@ -252,7 +252,7 @@ fn get_time_from_file_name(
|
|||
archive_entry: &DirEntry,
|
||||
) -> Result<Option<NaiveDateTime>, std::io::Error> {
|
||||
let file_name = archive_entry.file_name().to_str().unwrap().to_string();
|
||||
let name: Vec<&str> = file_name.split('_').collect();
|
||||
let name: Vec<&str> = file_name.split("_backup.tar.gz").collect();
|
||||
|
||||
Ok(chrono::NaiveDateTime::parse_from_str(name[0], "%d-%m-%y_%H.%M.%S").ok())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue