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/3
backup_error_fix
Joey Hines 2020-10-30 14:18:47 +01:00
commit b9aad433ba
1 changed files with 1 additions and 1 deletions

View File

@ -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())
}