Skip to content

Commit 0a66856

Browse files
committed
fix(remote-backup.sh): remove backups older 6 months and create a full copy every month.
1 parent 5c20f7c commit 0a66856

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vagrant/provisioning/roles/mystamps-backup/templates/remote-backup.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,20 @@ set -o errexit
66
UPLOADS_DST='{{ uploads_target_url }}'
77
MYSQL_BACKUPS_DST='{{ mysql_backups_target_url }}'
88
PASSPHRASE='{{ gpg_passphrase }}'
9-
DUPLICITY_CMD='duplicity --no-compression'
9+
DUPLICITY_CMD='duplicity --no-compression --full-if-older-than 1M'
1010

1111
case "${1:-}" in
1212
'uploads')
1313
su mystamps 2>&1 \
1414
-c "${DUPLICITY_CMD} --name=uploads --no-encryption /data/uploads ${UPLOADS_DST}"
15+
su mystamps 2>&1 \
16+
-c "duplicity remove-older-than 6M ${UPLOADS_DST}"
1517
;;
1618
'mysql-backups')
1719
PASSPHRASE="$PASSPHRASE" su mystamps 2>&1 \
1820
-c "${DUPLICITY_CMD} --name=mysql-backups /data/backups ${MYSQL_BACKUPS_DST}"
21+
su mystamps 2>&1 \
22+
-c "duplicity remove-older-than 6M ${MYSQL_BACKUPS_DST}"
1923
;;
2024
*)
2125
echo 2>&1 "Usage: $(dirname "$0") (uploads|mysql-backups)"

0 commit comments

Comments
 (0)