瀏覽代碼

removed folder compression, added rotation to mysqlbackups

Bachir Soussi Chiadmi 5 年之前
父節點
當前提交
0842f3f99e
共有 1 個文件被更改,包括 6 次插入5 次删除
  1. 6 5
      assets/mysqlbackup.sh

+ 6 - 5
assets/mysqlbackup.sh

@@ -48,10 +48,11 @@ do
 done
 
 # compress the folder
-tar -zcvf "${backup_dir}.tar.gz" "${backup_dir}"
-rm -rf "${backup_dir}"
+# tar -zcvf "${backup_dir}.tar.gz" "${backup_dir}"
+# rm -rf "${backup_dir}"
 
-
-# TODO rotate backups
+# Rotate backups
 # Delete files older than 30 days
-# find $backup_parent_dir/*.zip -mtime +30 -exec rm -rf {} \;
+find $backup_parent_dir/ -type f -mtime +30 -exec rm {} \;
+# Delete empty directories
+find $backup_parent_dir/ -type d -empty -delete;