local/bin/btrfs-snap-all: Reduce gap time to 10 minutes.

master
Pierre Neidhardt 2020-06-15 13:47:58 +02:00
parent a52272b290
commit 574168febf
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ usage () {
cat <<EOF>&2
Usage: ${0##*/}
Snapshot all Btrfs subvolumes older than 1 day to a read-only '.snapshots/SUBVOLUME/DATE'.
Snapshot all Btrfs subvolumes older than 10 minutes to a read-only '.snapshots/SUBVOLUME/DATE'.
Options:
@ -64,7 +64,7 @@ for fs in $(findmnt -t btrfs -n --output TARGET); do
fi
last_date=$(date --date="$last" +%s)
now=$(date +%s)
if [ $(($now - $last_date)) -gt 86400 ]; then
if [ $(($now - $last_date)) -gt 600 ]; then
snap "$fs" "$subvol"
fi
unset now