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:
parent
cf58530b80
commit
34e6ed4c89
|
@ -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
|
||||
|
|
|
@ -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 ) )
|
||||
|
||||
|
|
Loading…
Reference in New Issue