Update gauntmta_backup.sh

This commit is contained in:
2019-01-07 15:19:28 -05:00
parent e5431bb2ce
commit bfdda3b674

View File

@@ -13,7 +13,8 @@ tar -cpSzf "${TAR}" --exclude="${BACKUP_DIR}" --exclude=/var/cache --exclude=/va
# only keep 14 copies on local disk, seafile will keep deleted history
# https://stackoverflow.com/questions/25785/delete-all-but-the-most-recent-x-files-in-bash
ls -tp "${BACKUP_DIR}" | grep -v '/$' | tail -n +15 | xargs -I {} rm -- {}
cd "${BACKUP_DIR}"
ls -tp | grep -v '/$' | tail -n +15 | xargs -I {} rm -- {}
# sync the backup directory to seafile
rclone sync "${BACKUP_DIR}" seafile: