Quick fix for deleting old backups
+ This should be refactored in the futurebackup_error_fix
parent
cc85d287ef
commit
9b6fe56541
|
@ -252,7 +252,7 @@ fn get_time_from_file_name(
|
||||||
archive_entry: &DirEntry,
|
archive_entry: &DirEntry,
|
||||||
) -> Result<Option<NaiveDateTime>, std::io::Error> {
|
) -> Result<Option<NaiveDateTime>, std::io::Error> {
|
||||||
let file_name = archive_entry.file_name().to_str().unwrap().to_string();
|
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())
|
Ok(chrono::NaiveDateTime::parse_from_str(name[0], "%d-%m-%y_%H.%M.%S").ok())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue