From 9b6fe56541c21c039e6041282ea1134cd08c72e6 Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Fri, 30 Oct 2020 08:09:00 -0500 Subject: [PATCH] Quick fix for deleting old backups + This should be refactored in the future --- src/backup.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backup.rs b/src/backup.rs index 92dc9b7..c7e8591 100644 --- a/src/backup.rs +++ b/src/backup.rs @@ -252,7 +252,7 @@ fn get_time_from_file_name( archive_entry: &DirEntry, ) -> Result, 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()) }