From bfd0749b1168564e0c7a4adc246c6b6aaaa7dc3e Mon Sep 17 00:00:00 2001 From: Bruno Fontes Date: Sun, 20 Feb 2022 19:03:43 -0300 Subject: [PATCH] BackupServer: adding/fixing other backups --- Services/backup-contabo.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Services/backup-contabo.sh b/Services/backup-contabo.sh index 78a1cde..e713cb3 100755 --- a/Services/backup-contabo.sh +++ b/Services/backup-contabo.sh @@ -12,20 +12,27 @@ fi sleep 60 # Backup Contabo -/bin/rsync --archive --exclude "files/nextcloud*" --rsh=ssh backupContabo:/home/bruno/backups/* $CONTABO_BACKUP_PATH - -# Backup OXO -/bin/rsync --archive --rsh=ssh oxo:~/OXOwebsiteBackup.tar.gz ~/Backups/OXOwebsite/`date '+%Y-%m-%d'`_OXOwebsiteBackup.tar.gz +/bin/rsync --archive --backup --exclude "files/nextcloud*" --rsh=ssh backupContabo:/home/bruno/backups/* $CONTABO_BACKUP_PATH # Backup Gitea -/bin/rsync --archive --rsh=ssh googlemicro:~/ttt/*.zip ~/Backups/gitea/`date '+%Y-%m-%d'`_gitea.zip +/bin/rsync --archive --backup --rsh=ssh bkpgitea:~/ttt/* ~/Backups/gitea/ + +# Backup OXO Files +/bin/rsync --archive --backup --rsh=ssh oxo:~/public_html ~/Backups/OXOwebsite/ +tar cfz ~/Backups/OXOwebsite/`date '+%Y-%m-%d'`_OXOwebsiteBackup.tar.gz ~/Backups/OXOwebsite/public_html/ +rm -rf ~/Backups/OXOwebsite/public_html/ + +# Backup OXO DB +ssh oxo ./backupDB.sh +/bin/rsync --archive --backup --compress --rsh=ssh oxo:~/db/* ~/Backups/OXOwebsite/ +ssh oxo rm ./db/* # Delete old backups find $CONTABO_BACKUP_PATH/db -type f -name "*.sql.gz" -mtime +15 -delete find $CONTABO_BACKUP_PATH/keys -type f -name "*.*" -mtime +15 -delete find $CONTABO_BACKUP_PATH/files -type f -name "*.*" -mtime +35 -delete find $CONTABO_BACKUP_PATH/mail -type f -name "*.*" -mtime +20 -delete - find $CONTABO_BACKUP_PATH/ -type f -name "*.*" -mtime +120 -delete -find ~/Backups/OXOwebsite/ -type f -name "*.sql.gz" -mtime +15 -delete +find ~/Backups/OXOwebsite/ -type f -name "*.gz" -mtime +15 -delete +find ~/Backups/gitea/ -type f -name "*.zip" -mtime +15 -delete