Update backup.sh

This commit is contained in:
Xiufeng Guo 2024-07-12 04:13:34 +09:00
parent 9e918e964b
commit 80b1f95a72
Signed by: showfom
GPG Key ID: 29A7777777777777

View File

@ -43,10 +43,10 @@ fi
# Copy the database and website backup
if [ -n "$database_name" ]; then
rclone copy /opt/backup/dbbackup-$backup_folder_name.tar.gz $rclone_config_name:$s3_bucket_name/$backup_folder_name
rclone copy /opt/backup/dbbackup-$backup_folder_name.sql.gz $rclone_config_name:$s3_bucket_name/$backup_folder_name -P --s3-no-check-bucket
fi
rclone copy /opt/backup/website-$backup_folder_name.tar.gz $rclone_config_name:$s3_bucket_name/$backup_folder_name
rclone copy /opt/backup/website-$backup_folder_name.tar.gz $rclone_config_name:$s3_bucket_name/$backup_folder_name -P --s3-no-check-bucket
# Purge old backups for more than 7 days
rclone purge $rclone_config_name:$s3_bucket_name/$(date -d "7 days ago" "+%Y_%m_%d")