From 083f94b831a94beb8a71457bd2dc6e988f351c6a Mon Sep 17 00:00:00 2001 From: Daniel Dolezal <40464775+daniel156161@users.noreply.github.com> Date: Sat, 22 Aug 2020 01:34:40 +0200 Subject: [PATCH] Update backup.sh --- backup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backup.sh b/backup.sh index d2b385f..c754333 100755 --- a/backup.sh +++ b/backup.sh @@ -60,3 +60,6 @@ url=${PFSENSE_SCHEME}://${PFSENSE_IP} timestamp=$(date +%Y%m%d%H%M%S) do_backup +if [ ! -z $keepfiles ]; then + ls -d -1tr $destination/* | head -n -$keepfiles | xargs -d '\n' rm -f +fi