diff --git a/roles/kde-backup/templates/backup-ange.sh b/roles/kde-backup/templates/backup-ange.sh index 5715efd..d6121f9 100755 --- a/roles/kde-backup/templates/backup-ange.sh +++ b/roles/kde-backup/templates/backup-ange.sh @@ -1,16 +1,16 @@ LOCATION=/root/{{backup_directory}} # Cleanup old backups find $LOCATION/ -name '*gz' -mtime +7 | xargs rm -f # Backup system configuration, package listing and cronjobs dpkg -l > $LOCATION/dpkg.`date +%w` tar -czf $LOCATION/crontabs.`date +%w`.tgz -C / var/spool/cron/ tar -czf $LOCATION/etc.`date +%w`.tgz -C / etc/ # Secure our backups chmod -R 700 $LOCATION # Transfer them to the backup server cd $LOCATION/.. -rsync --timeout=600 --delete -a backups -4 angebackup@gohma.kde.org: +rsync --timeout=600 --delete -a backups -4 {{gohma_backup_user}}@gohma.kde.org: diff --git a/roles/kde-backup/templates/backup-bluemchen.sh b/roles/kde-backup/templates/backup-bluemchen.sh index 9d8a82f..7a56bf9 100755 --- a/roles/kde-backup/templates/backup-bluemchen.sh +++ b/roles/kde-backup/templates/backup-bluemchen.sh @@ -1,23 +1,23 @@ LOCATION=/root/{{backup_directory}} # Cleanup old backups... find $LOCATION -name '*gz' -mtime +7 | xargs rm -f # Grab software we've installed tar -czf $LOCATION/srv-files-bluemchen.`date +%w`.tgz -C / srv/ # Grab the system config, package listing and crontabs tar -czf $LOCATION/etc.`date +%w`.tgz -C / etc/ tar -czf $LOCATION/crontabs.`date +%w`.tgz -C / var/spool/cron/ tar -czf $LOCATION/root-bin-bluemchen.`date +%w`.tgz -C / root/bin/ root/hetzner/ dpkg -l > $LOCATION/dpkg.`date +%w` # Secure the backups chmod -R 700 $LOCATION # Transfer them to the backup server cd $LOCATION/.. -rsync --timeout=600 --delete -a backup bluemchenbackup@gohma.kde.org: +rsync --timeout=600 --delete -a backup {{gohma_backup_user}}@gohma.kde.org: # Also backup home directories. As they're quite large we just transfer them directly -rsync --timeout=600 --delete -a /home/ bluemchenbackup@gohma.kde.org:~/homes/ +rsync --timeout=600 --delete -a /home/ {{gohma_backup_user}}@gohma.kde.org:~/homes/ diff --git a/roles/kde-backup/templates/backup-cano.sh b/roles/kde-backup/templates/backup-cano.sh index dceb180..2773563 100755 --- a/roles/kde-backup/templates/backup-cano.sh +++ b/roles/kde-backup/templates/backup-cano.sh @@ -1,16 +1,16 @@ LOCATION=/root/{{backup_directory}} # Cleanup old backups find $LOCATION -name '*gz' -mtime +7 | xargs rm -f # Backup system configuration, crontabs and package listing tar -czf $LOCATION/etc.`date +%w`.tgz -C / etc/ tar -czf $LOCATION/crontabs.`date +%w`.tgz -C / var/spool/cron/ dpkg -l > $LOCATION/dpkg.`date +%w` # Secure the backups chmod -R 700 $LOCATION # Transfer them to their final home cd $LOCATION/.. -rsync --timeout=600 --delete -a backup -4 canobackup@gohma.kde.org: +rsync --timeout=600 --delete -a backup -4 {{gohma_backup_user}}@gohma.kde.org: diff --git a/roles/kde-backup/templates/backup-dalca.sh b/roles/kde-backup/templates/backup-dalca.sh index 91205a7..521d6ef 100755 --- a/roles/kde-backup/templates/backup-dalca.sh +++ b/roles/kde-backup/templates/backup-dalca.sh @@ -1,16 +1,16 @@ LOCATION=/root/{{backup_directory}} # Cleanup old backups find $LOCATION/ -name '*gz' -mtime +7 | xargs rm -f # Grab the system configuration, package listing, and cronjobs dpkg -l > $LOCATION/dpkg.`date +%w` tar -czf $LOCATION/crontabs.`date +%w`.tgz -C / var/spool/cron/ tar -czf $LOCATION/etc.`date +%w`.tgz -C / etc/ # Secure our backups chmod -R 700 $LOCATION # Transfer them to the backup server cd $LOCATION/.. -rsync --timeout=600 --delete -a backups -4 dalcabackup@gohma.kde.org: +rsync --timeout=600 --delete -a backups -4 {{gohma_backup_user}}@gohma.kde.org: diff --git a/roles/kde-backup/templates/backup-elder.sh b/roles/kde-backup/templates/backup-elder.sh index 5916068..1184d2c 100755 --- a/roles/kde-backup/templates/backup-elder.sh +++ b/roles/kde-backup/templates/backup-elder.sh @@ -1,11 +1,11 @@ LOCATION=/root/{{backup_directory}} # Backup configuration and list of installed packages tar -czf $LOCATION/etc.`date +%w`.tgz -C / etc/ tar -czf $LOCATION/cronjobs.`date +%w`.tgz -C / var/spool/cron/ dpkg -l > $LOCATION/dpkg.`date +%w` chmod -R 700 $LOCATION cd $LOCATION/.. -rsync --timeout=600 --delete -a backups -4 elderbackup@gohma.kde.org: +rsync --timeout=600 --delete -a backups -4 {{gohma_backup_user}}@gohma.kde.org: diff --git a/roles/kde-backup/templates/backup-fiesta.sh b/roles/kde-backup/templates/backup-fiesta.sh index e057ba7..c83ffcc 100755 --- a/roles/kde-backup/templates/backup-fiesta.sh +++ b/roles/kde-backup/templates/backup-fiesta.sh @@ -1,16 +1,16 @@ LOCATION=/root/{{backup_directory}} # Cleanup old backups find $LOCATION/ -name '*gz' -mtime +7 | xargs rm -f # Grab a list of system packages and the system configuration dpkg -l > $LOCATION/dpkg.`date +%w` tar -czf $LOCATION/crontabs.`date +%w`.tgz -C / var/spool/cron/ tar -czf $LOCATION/etc.`date +%w`.tgz -C / etc/ # Secure the backups chmod -R 700 $LOCATION # Send them off to the backup server cd $LOCATION/.. -rsync --timeout=600 --delete -a backup -4 fiestabackup@gohma.kde.org: +rsync --timeout=600 --delete -a backup -4 {{gohma_backup_user}}@gohma.kde.org: diff --git a/roles/kde-backup/templates/backup-letterbox.sh b/roles/kde-backup/templates/backup-letterbox.sh index a16971f..cfb1f73 100644 --- a/roles/kde-backup/templates/backup-letterbox.sh +++ b/roles/kde-backup/templates/backup-letterbox.sh @@ -1,30 +1,30 @@ #!/bin/bash LOCATION=/root/{{backup_directory}} # Grab our databases for DATABASE in `mysqlshow | grep -v "information_schema" | grep -v "performance_schema" | grep -v "mysql" | tail -n+4 | awk '{print $2}'`; do mysqldump --skip-extended-insert $DATABASE | xz - > $LOCATION/db.$DATABASE.`date +%w`.sql.xz done # Backup the mailman install and some other tools tar -cJf $LOCATION/mailman-install.`date +%w`.tar.xz -C / usr/lib/mailman tar -cJf $LOCATION/root-scripts.`date +%w`.tar.xz -C / root/bin tar -cJf $LOCATION/commitfilter.`date +%w`.tar.xz -C / --exclude=home/commitfilter/procmail.log home/commitfilter # Backup the system configuration, crontabs and package listing tar -czf $LOCATION/etc.`date +%w`.tgz -C / etc/ tar -czf $LOCATION/crontabs.`date +%w`.tgz -C / var/spool/cron/ dpkg -l > $LOCATION/dpkg.`date +%w` # Transfer traditional backups to the backup server cd $LOCATION/.. -rsync --timeout=600 --delete -a backup -4 letterboxbackup@gohma.kde.org:backup/archives/ +rsync --timeout=600 --delete -a backup -4 {{gohma_backup_user}}@gohma.kde.org:backup/archives/ # Prepare to run Borg backups export BORG_PASSPHRASE='{{backup_borg_passphrase}}' export BORG_SERVER="{{gohma_backup_user}}@gohma.kde.org" # Backup Mailman archives and lists export BORG_REPO="$BORG_SERVER:backup/borg/mailman" borg create --compression zlib,5 --exclude-caches ::'{hostname}-mailman-{now}' /mnt/data/mailman/ borg prune --prefix '{hostname}-' --keep-daily 7 --keep-weekly 4 --keep-monthly 6 2>&1 | grep -v "Compacting segments" diff --git a/roles/kde-backup/templates/backup-library.sh b/roles/kde-backup/templates/backup-library.sh index 40a47f0..9ff8bdd 100755 --- a/roles/kde-backup/templates/backup-library.sh +++ b/roles/kde-backup/templates/backup-library.sh @@ -1,16 +1,16 @@ LOCATION=/root/{{backup_directory}} # Cleanup old backups find $LOCATION/ -name '*gz' -mtime +7 | xargs rm -f # Grab the system configuration, package listing and cronjobs dpkg -l > $LOCATION/dpkg.`date +%w` tar -czf $LOCATION/crontabs.`date +%w`.tgz -C / var/spool/cron/ tar -czf $LOCATION/etc.`date +%w`.tgz -C / etc/ # Secure our backups chmod -R 700 $LOCATION # Transfer them to the backup server now cd $LOCATION/.. -rsync --timeout=600 --delete -a backups -4 librarybackup@gohma.kde.org: +rsync --timeout=600 --delete -a backups -4 {{gohma_backup_user}}@gohma.kde.org: diff --git a/roles/kde-backup/templates/backup-mason.sh b/roles/kde-backup/templates/backup-mason.sh index c05d091..5a90d0b 100755 --- a/roles/kde-backup/templates/backup-mason.sh +++ b/roles/kde-backup/templates/backup-mason.sh @@ -1,18 +1,18 @@ LOCATION=/root/{{backup_directory}} # Cleanup old backups find $LOCATION -name '*gz' -mtime +6 | xargs rm -f # Capture home directories tar -cf $LOCATION/home.`date +%w`.tar -C / home/ 2>&1 | grep -v "socket ignored" gzip -f $LOCATION/home.`date +%w`.tar tar -czf $LOCATION/etc.`date +%w`.tgz -C / etc/ tar -czf $LOCATION/crontabs.`date +%w`.tgz -C / var/spool/cron/ dpkg -l > $LOCATION/dpkg.`date +%w` chmod -R 700 $LOCATION cd $LOCATION/.. -rsync --timeout=600 --delete -a backup masonbackup@gohma.kde.org: +rsync --timeout=600 --delete -a backup {{gohma_backup_user}}@gohma.kde.org: diff --git a/roles/kde-backup/templates/backup-olios.sh b/roles/kde-backup/templates/backup-olios.sh index bb7c6b3..81dc108 100755 --- a/roles/kde-backup/templates/backup-olios.sh +++ b/roles/kde-backup/templates/backup-olios.sh @@ -1,24 +1,24 @@ LOCATION=/root/{{backup_directory}} # Backup databases for DATABASE in `mysqlshow | grep -v "information_schema" | grep -v "performance_schema" | grep -v "mysql" | tail -n+4 | awk '{print $2}'`; do mysqldump --opt --quick --single-transaction --skip-extended-insert --events --create-options --set-charset $DATABASE > $LOCATION/db.$DATABASE.`date +%w`.sql xz -f $LOCATION/db.$DATABASE.`date +%w`.sql done # Backup website contents tar -cJf $LOCATION/srv.`date +%w`.tar.xz -C / --exclude=srv/www/svn --exclude=srv/www/git --exclude=srv/www/static.kdenews.org --exclude=srv/www/docs.kde.org srv/www 2>&1 | grep -v "we read it" # Backup homes as well tar -cJf $LOCATION/homes.`date +%w`.tar.xz -C / home/ 2>&1 | grep -v "we read it" # Backup configuration and list of installed packages tar -czf $LOCATION/etc.`date +%w`.tgz -C / etc/ tar -czf $LOCATION/crontabs.`date +%w`.tgz -C / var/spool/cron/ dpkg -l > $LOCATION/dpkg.`date +%w` # Upload to the main host chmod -R 700 $LOCATION cd $LOCATION/.. -rsync --timeout=600 --delete -a backup -4 oliosbackup@gohma.kde.org: +rsync --timeout=600 --delete -a backup -4 {{gohma_backup_user}}@gohma.kde.org: diff --git a/roles/kde-backup/templates/backup-orbi.sh b/roles/kde-backup/templates/backup-orbi.sh index 0ce4534..52af823 100755 --- a/roles/kde-backup/templates/backup-orbi.sh +++ b/roles/kde-backup/templates/backup-orbi.sh @@ -1,27 +1,27 @@ LOCATION=/root/{{backup_directory}} find $LOCATION -name '*xz' -mtime +21 | xargs rm -f # Backup website files, system configuration and user home directories tar -cJf $LOCATION/srv.`date +%w`.tar.xz -C / srv/ tar -cJf $LOCATION/homes.`date +%w`.tar.xz -C / home/ 2>&1 | grep -v "file changed as we read it" # Backup databases for DATABASE in `mysqlshow | grep -v "information_schema" | grep -v "performance_schema" | grep -v "mysql" | grep -v "sys" | tail -n+4 | awk '{print $2}'`; do mysqldump --opt --quick --single-transaction --skip-extended-insert --events --create-options --set-charset $DATABASE > $LOCATION/db.$DATABASE.`date +%w`.sql xz -f $LOCATION/db.$DATABASE.`date +%w`.sql done # Backup openldap /usr/sbin/slapcat -f /etc/ldap/slapd.conf -b dc=kde,dc=org | xz -3 > $LOCATION/ldap.`date +%w`.ldif.xz # Grab a list of installed packages, the system config and crontabs tar -cJf $LOCATION/etc.`date +%w`.tar.xz -C / etc/ tar -cJf $LOCATION/crontabs.`date +%w`.tar.xz -C / var/spool/cron/ dpkg -l > $LOCATION/dpkg.`date +%w` # Secure our backups chmod -R 700 $LOCATION # Transfer them to safety cd $LOCATION/.. -rsync --timeout=600 --delete -a backups -4 orbibackup@gohma.kde.org: +rsync --timeout=600 --delete -a backups -4 {{gohma_backup_user}}@gohma.kde.org: diff --git a/roles/kde-backup/templates/backup-overwatch.sh b/roles/kde-backup/templates/backup-overwatch.sh index 4dd6f77..6a60d01 100755 --- a/roles/kde-backup/templates/backup-overwatch.sh +++ b/roles/kde-backup/templates/backup-overwatch.sh @@ -1,23 +1,23 @@ #!/bin/bash LOCATION=/root/{{backup_directory}} # Backup configuration and list of installed packages tar -czf $LOCATION/etc.`date +%w`.tgz -C / etc/ tar -czf $LOCATION/crontabs.`date +%w`.tgz -C / var/spool/cron/ dpkg -l > $LOCATION/dpkg.`date +%w` # Grab Grafana's own backups cp /var/lib/grafana/grafana.db $LOCATION/grafana.db.`date +%w` # Transfer backups to Gohma chmod -R 700 $LOCATION -rsync --timeout=600 -a backup overwatchbackup@gohma.kde.org: +rsync --timeout=600 -a backup {{gohma_backup_user}}@gohma.kde.org: # Prepare to run Borg export BORG_PASSPHRASE='{{backup_borg_passphrase}}' -export BORG_SERVER="overwatchbackup@gohma.kde.org" +export BORG_SERVER="{{gohma_backup_user}}@gohma.kde.org" # Backup InfluxDB for Grafana export BORG_REPO="$BORG_SERVER:backup/borg/influxdb-grafana" borg create --compression zlib,3 --exclude-caches ::'{hostname}-influxdb-{now}' /var/lib/influxdb 2>&1 | grep -v "Compacting segments" borg prune --prefix '{hostname}-' --keep-daily 7 --keep-weekly 4 --keep-monthly 6 2>&1 | grep -v "Compacting segments" diff --git a/roles/kde-backup/templates/backup-rosetta.sh b/roles/kde-backup/templates/backup-rosetta.sh index 62c9293..abf0666 100755 --- a/roles/kde-backup/templates/backup-rosetta.sh +++ b/roles/kde-backup/templates/backup-rosetta.sh @@ -1,25 +1,25 @@ LOCATION=/root/{{backup_directory}} # Backup databases for DATABASE in `mysqlshow | grep -v "information_schema" | grep -v "performance_schema" | grep -v "mysql" | tail -n+4 | awk '{print $2}'`; do mysqldump --opt --quick --single-transaction --skip-extended-insert --events --create-options --set-charset $DATABASE > $LOCATION/db.$DATABASE.`date +%w`.sql xz -f $LOCATION/db.$DATABASE.`date +%w`.sql done # Backup homes! tar -cJf $LOCATION/homes.`date +%w`.tar.xz --exclude=home/scripty/prod -C / home/ # Backup application data tar -cJf $LOCATION/srv.`date +%w`.tar.xz -C / --exclude=srv/l10n-svn srv/ 2>&1 | grep -v "file changed as we read it" # Backup configuration and list of installed packages tar -czf $LOCATION/etc.`date +%w`.tgz -C / etc/ tar -czf $LOCATION/crontabs.`date +%w`.tgz -C / var/spool/cron/ dpkg -l > $LOCATION/dpkg.`date +%w` # Secure the backups chmod -R 700 $LOCATION # Transfer them to the backup server cd $LOCATION/.. -rsync --timeout=600 --delete -a backups -4 rosettabackup@gohma.kde.org: +rsync --timeout=600 --delete -a backups -4 {{gohma_backup_user}}@gohma.kde.org: diff --git a/roles/kde-backup/templates/backup-shrek.sh b/roles/kde-backup/templates/backup-shrek.sh index 788fd78..e622f6a 100755 --- a/roles/kde-backup/templates/backup-shrek.sh +++ b/roles/kde-backup/templates/backup-shrek.sh @@ -1,9 +1,9 @@ LOCATION=/root/{{backup_directory}} tar -czf $LOCATION/etc.`date +%w`.tgz -C / etc/ rpm -qa > $LOCATION/rpm.`date +%w` chmod -R 700 $LOCATION cd $LOCATION/.. -rsync --timeout=600 --delete -a backup shrekbackup@gohma.kde.org: +rsync --timeout=600 --delete -a backup {{gohma_backup_user}}@gohma.kde.org: diff --git a/roles/kde-backup/templates/backup-stumptown.sh b/roles/kde-backup/templates/backup-stumptown.sh index 78e6e12..c933cca 100755 --- a/roles/kde-backup/templates/backup-stumptown.sh +++ b/roles/kde-backup/templates/backup-stumptown.sh @@ -1,34 +1,34 @@ #!/bin/bash LOCATION=/root/{{backup_directory}} # Cleanup old backups find $LOCATION -mtime +21 | xargs rm -f # Determine the machine hosting our databases SERVER=`cat ~/db.passwds | grep server | grep -v "kde_dot" | awk '{print $2}'` # Backup the databases IFS="|" for original in `grep "^kde" ~/db.passwds | tr -s " " | tr -d "\n"` ; do DB=${original%% *}; rest=${original#* } USER=${rest%% *}; rest=${rest#* } PASS=${rest%% *}; mysqldump --skip-extended-insert -h$SERVER -u$USER -p$PASS $DB > $LOCATION/db.$DB.`date +%W`.sql; xz -f $LOCATION/db.$DB.`date +%W`.sql; done # Grab all of the web applications we run rm $LOCATION/srv-www.tar.xz tar -cJf $LOCATION/srv-www.tar.xz -C / srv # Grab the system configuration, package listing and cronjobs tar -cf $LOCATION/etc.`date +%W`.tar -C / etc/ tar -czf $LOCATION/crontabs.`date +%W`.tgz -C / var/spool/cron/ dpkg -l > $LOCATION/dpkg.`date +%W` # Secure our backups chmod -R 700 $LOCATION # Transfer them to our backup server cd $LOCATION/.. -rsync --timeout=600 --delete -a backups stumptownbackup@gohma.kde.org: +rsync --timeout=600 --delete -a backups {{gohma_backup_user}}@gohma.kde.org: