Add globs to borg prune to keep archives of db AND data

main
Marco von Rosenberg 2 years ago
parent 2c9b4b75f2
commit ec331c3d2a
  1. 7
      backups/gitea.sh
  2. 7
      backups/matrix.sh
  3. 7
      backups/nextcloud.sh
  4. 7
      backups/pad.sh

@ -12,10 +12,13 @@ echo "Starting Backup of Gitea Database..."
docker exec gitea_db_1 pg_dump gitea -U gitea |
/usr/bin/borg create --compression zstd --stats ${BACKUP_REPO}::${BACKUP_NAME_DB} -
echo "Backup done. Pruning Gitea Database..."
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 -a "db_*" ${BACKUP_REPO}
echo "Starting Backup of Gitea Data..."
/usr/bin/borg create --compression zstd --stats ${BACKUP_REPO}::${BACKUP_NAME_DATA} /srv/docker-containers/gitea/gitea-data
echo "Backup done. Pruning backup-repo..."
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 ${BACKUP_REPO}
echo "Backup done. Pruning Gitea Data..."
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 -a "data_*" ${BACKUP_REPO}
echo "Done"

@ -12,10 +12,13 @@ echo "Starting Backup of Matrix / Synapse Database..."
docker exec matrix-postgres pg_dump synapse -U synapse |
/usr/bin/borg create --compression zstd --stats ${BACKUP_REPO}::${BACKUP_NAME_DB} -
echo "Backup done. Pruning Matrix / Synapse Database..."
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 -a "db_*" ${BACKUP_REPO}
echo "Starting Backup of Matrix / Synapse Storage..."
/usr/bin/borg create --compression zstd --stats ${BACKUP_REPO}::${BACKUP_NAME_DATA} /matrix/synapse/storage
echo "Backup done. Pruning backup-repo..."
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 ${BACKUP_REPO}
echo "Backup done. Pruning Matrix / Synapse Storage..."
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 -a "synapse-storage_*" ${BACKUP_REPO}
echo "Done"

@ -12,10 +12,13 @@ echo "Starting Backup of Nextcloud Database..."
docker exec nextcloud_nc_db_1 mysqldump -u nextcloud -pnextcloud --lock-tables --databases nextcloud |
/usr/bin/borg create --compression zstd --stats ${BACKUP_REPO}::${BACKUP_NAME_DB} -
echo "Backup done. Pruning Nextcloud Database..."
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 -a "db_*" ${BACKUP_REPO}
echo "Starting Backup of Nextcloud Uploaded Files..."
/usr/bin/borg create --compression zstd --stats ${BACKUP_REPO}::${BACKUP_NAME_DATA} /srv/docker-containers/nextcloud/nextcloud-data
echo "Backup done. Pruning backup-repo..."
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 ${BACKUP_REPO}
echo "Backup done. Pruning Nextcloud Uploaded Files..."
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 -a "data_*" ${BACKUP_REPO}
echo "Done"

@ -12,10 +12,13 @@ echo "Starting Backup of Pad Database..."
docker exec pad_database_1 pg_dump hedgedoc -U hedgedoc |
/usr/bin/borg create --compression zstd --stats ${BACKUP_REPO}::${BACKUP_NAME_DB} -
echo "Backup done. Pad Database..."
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 -a "db_*" ${BACKUP_REPO}
echo "Starting Backup of Pad Uploaded Files..."
/usr/bin/borg create --compression zstd --stats ${BACKUP_REPO}::${BACKUP_NAME_UPLOADS} /srv/docker-containers/pad/uploads
echo "Backup done. Pruning backup-repo..."
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 ${BACKUP_REPO}
echo "Backup done. Pruning Pad Uploaded Files..."
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 -a "uploads_*" ${BACKUP_REPO}
echo "Done"

Loading…
Cancel
Save