Skip to content
Snippets Groups Projects
Commit 605ed798 authored by Vladimír Štill's avatar Vladimír Štill
Browse files

backup-tar: Fix indent

parent 22e4f224
No related branches found
No related tags found
No related merge requests found
......@@ -34,21 +34,21 @@ get_snars() { find $1/ -type f -name '*.snar' -printf '%f\n' | sort; }
get_type() {
mkdir -p "$1"
if ! ls $1/*.snar >&/dev/null; then
echo full
else
LAST_FULL=$(date --date=$(get_snars $1 | grep full | tail -n1 | sed 's/[.].*$//') +%s)
LAST_BIG=$(date --date=$(get_snars $1 | grep '\(full\|weekly\)' | tail -n1 | sed 's/[.].*$//') +%s)
NOW=$(date +%s)
# do a full backup every 8 weeks
if [[ $(($NOW - $LAST_FULL)) -ge $((3600 * 24 * 7 * 8)) ]]; then
echo full
elif [[ $(($NOW - $LAST_BIG)) -ge $((3600 * 24 * 7)) ]]; then
echo weekly
else
echo daily
fi
fi
if ! ls $1/*.snar >&/dev/null; then
echo full
else
LAST_FULL=$(date --date=$(get_snars $1 | grep full | tail -n1 | sed 's/[.].*$//') +%s)
LAST_BIG=$(date --date=$(get_snars $1 | grep '\(full\|weekly\)' | tail -n1 | sed 's/[.].*$//') +%s)
NOW=$(date +%s)
# do a full backup every 8 weeks
if [[ $(($NOW - $LAST_FULL)) -ge $((3600 * 24 * 7 * 8)) ]]; then
echo full
elif [[ $(($NOW - $LAST_BIG)) -ge $((3600 * 24 * 7)) ]]; then
echo weekly
else
echo daily
fi
fi
}
for SRC in $SOURCES; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment