diff --git a/roles/kde-backup/templates/backup-eresida.sh b/roles/kde-backup/templates/backup-eresida.sh index 91d048d..71d0011 100644 --- a/roles/kde-backup/templates/backup-eresida.sh +++ b/roles/kde-backup/templates/backup-eresida.sh @@ -1,16 +1,16 @@ LOCATION=/root/{{backup_directory}} find $LOCATION -name '*.tar' -mtime +7 | xargs --no-run-if-empty rm -fv # 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` # Backup GitLab tar -czf $LOCATION/gitlab-config.`date +%w`.tgz -C / srv/gitlab/gitlab/config sudo -u git -H sh -c 'cd /srv/gitlab/gitlab && bundle exec rake gitlab:backup:create RAILS_ENV=production SKIP=repositories CRON=1' -mv /srv/gitlab/gitlab/tmp/backups/* $LOCATION/ +mv /srv/gitlab/gitlab/tmp/backups/*gitlab_backup.tar $LOCATION/ # Transfer the backups to the backup server lftp -f ~/bin/backup-options