make weekly backup indepentend of month

This commit is contained in:
Shannon Sterz 2017-07-22 17:14:35 +02:00
parent e848189f02
commit 7f2592ed20

View file

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
## Create by Stefan Sterz <hi@sterzy.com> in 2017
## General Settings ## General Settings
SOURCES=(/root /etc /home /boot) # What folder should be saved? SOURCES=(/root /etc /home /boot) # What folder should be saved?
@ -141,7 +142,7 @@ fi
# Create a special backup approx every week # Create a special backup approx every week
if [[ $WEEKDAY = 7 ]]; then if [[ $WEEKDAY = 7 ]]; then
let WEEK=($DAY+6)/7 let WEEK=$($DATE +"%W")%5 # save past 5 weeks
backup "weekly/$WEEK" backup "weekly/$WEEK"
fi fi