From 7f2592ed20ffd93f891519a187d5a47fe1de272e Mon Sep 17 00:00:00 2001 From: Stefan Sterz Date: Sat, 22 Jul 2017 17:14:35 +0200 Subject: [PATCH] make weekly backup indepentend of month --- backup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backup.sh b/backup.sh index a083605..28b7c5e 100755 --- a/backup.sh +++ b/backup.sh @@ -1,4 +1,5 @@ #!/bin/bash +## Create by Stefan Sterz in 2017 ## General Settings SOURCES=(/root /etc /home /boot) # What folder should be saved? @@ -141,7 +142,7 @@ fi # Create a special backup approx every week if [[ $WEEKDAY = 7 ]]; then - let WEEK=($DAY+6)/7 + let WEEK=$($DATE +"%W")%5 # save past 5 weeks backup "weekly/$WEEK" fi