diff --git a/gauntmta_backup.sh b/gauntmta_backup.sh index 814b058..446e0dc 100644 --- a/gauntmta_backup.sh +++ b/gauntmta_backup.sh @@ -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: