From b17e1e54e8cc25b89ec0a5a3b1da3bb72bf307cd Mon Sep 17 00:00:00 2001 From: Mustapha Zorgati <15628173+mustaphazorgati@users.noreply.github.com> Date: Mon, 22 Feb 2021 19:23:39 +0100 Subject: [PATCH] now using rclone --min-age flag to determine age of backups --- scripts/backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup.sh b/scripts/backup.sh index 58c9415..7ce009e 100644 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -108,7 +108,7 @@ function clear_history() { if [[ "${BACKUP_KEEP_DAYS}" -gt 0 ]]; then color blue "delete ${BACKUP_KEEP_DAYS} days ago backup files" - local RCLONE_DELETE_LIST=$(rclone lsf "${RCLONE_REMOTE}" | head -n -${BACKUP_KEEP_DAYS}) + local RCLONE_DELETE_LIST=$(rclone lsf "${RCLONE_REMOTE}" --min-age ${BACKUP_KEEP_DAYS}d) for RCLONE_DELETE_FILE in ${RCLONE_DELETE_LIST} do