1
0
Fork 0
mirror of https://github.com/nachoparker/btrfs-snp.git synced 2024-05-09 11:46:05 +02:00

support absolute paths

This commit is contained in:
nachoparker 2018-11-11 12:40:13 -07:00
parent cf58530b80
commit 34e6ed4c89
2 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ Usage: btrfs-snp <dir> (<tag>) (<limit>) (<seconds>) (<destdir>)
tag │ name the snapshot <tag>_<timestamp>
limit │ keep <limit> snapshots with this tag. 0 to disable
seconds │ don't create snapshots before <seconds> have passed from last with this tag. 0 to disable
destdir │ store snapshot in <destdir>, relative to <dir>
destdir │ store snapshot in <destdir>, path absolute or relative to <dir>
```
## Examples

View File

@ -31,7 +31,7 @@ function btrfs-snp()
tag │ name the snapshot <tag>_<timestamp>
limit │ keep <limit> snapshots with this tag. 0 to disable
seconds │ don't create snapshots before <seconds> have passed from last with this tag. 0 to disable
destdir │ store snapshot in <destdir>, relative to <dir>
destdir │ store snapshot in <destdir>, path absolute or relative to <dir>
Cron example: Hourly snapshot for one day, daily for one week, weekly for one month, and monthly for one year.
@ -60,7 +60,7 @@ chmod +x /etc/cron.hourly/$BIN"
}
}
DST="$DIR/$DST"
[[ "$DST" = /* ]] || DST="$DIR/$DST"
mkdir -p "$DST"
local SNAPS=( $( ls -d "$DST/${TAG}_"* 2>/dev/null ) )