diff options
author | Erich Eckner <git@eckner.net> | 2018-10-10 11:28:33 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-10-10 11:28:33 +0200 |
commit | 2159b5b9f8b55e49b013fc3f663cff0b0ab53bc3 (patch) | |
tree | 03119c77a70919aa678fabe476148fcab5776a8c /backup.in | |
parent | 2385fb21689538a11c224d82af14775a56e9cbbb (diff) | |
download | hardlinkedBackups-2159b5b9f8b55e49b013fc3f663cff0b0ab53bc3.tar.xz |
option for seldom backups new
Diffstat (limited to 'backup.in')
-rwxr-xr-x | backup.in | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -38,11 +38,16 @@ then fi fi +seldom=false if [ $# -eq 0 ] then backupID="$(basename $0)" [ -z "${backups[${backupID}]}" ] && usage set /tmp/${backupID}.pid ${backups[${backupID}]} + if printf '%s\n' "${seldomBackups[@]}" | \ + grep -qxF "${backupID}"; then + seldom=true + fi fi Basis="$2" @@ -95,6 +100,13 @@ fi [ -w "${Basis}" ] || exit 11 [ -e "${neues_Datum}" ] && exit 4 +if ${seldom}; then + for date_diff in $(seq ${seldomness}); do + if [ -e "${Basis}/$(date '+%Y_%m_%d' -d@$(($(date '+%s')-24*60*60*date_diff)))" ]; then + exit 4 + fi + done +fi [ -e "${pidFile}" ] && exit 5 echo $$ > "${pidFile}" |