From dc9571732907dccf9e9bef964e2adc3c73c667ac Mon Sep 17 00:00:00 2001 From: Bruno Moreira De Barros Date: Thu, 18 May 2017 11:07:14 +0000 Subject: [PATCH] Fixes an issue with processing backups for database names with periods OCin their name. --- lib/s3_mysql_backup.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/s3_mysql_backup.rb b/lib/s3_mysql_backup.rb index 3448cd4..4c2bef2 100644 --- a/lib/s3_mysql_backup.rb +++ b/lib/s3_mysql_backup.rb @@ -111,7 +111,7 @@ def remove_old_backups path = File.expand_path(config['backup_dir']) Dir["#{path}/*.sql.gz"].each do |name| - date = name.split('.')[1] + date = name.split('.')[-4] filedate = Date.strptime(date, '%Y%m%d') if filedate < weekly && filedate >= monthly