mirror of
https://github.com/zfsonlinux/zfs-auto-snapshot.git
synced 2025-08-23 02:10:37 +02:00
Compare commits
13 Commits
upstream/1
...
upstream/1
Author | SHA1 | Date | |
---|---|---|---|
|
d49be6a2de | ||
|
2e1f309131 | ||
|
1666623191 | ||
|
739972f18a | ||
|
8c45add2c0 | ||
|
9c6f065589 | ||
|
62f5f7d920 | ||
|
b74769894c | ||
|
11130ba8d6 | ||
|
c4ad5eeac5 | ||
|
b2e97c5fe0 | ||
|
d3bdd2dc23 | ||
|
f2767ad43a |
@@ -1,2 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec zfs-auto-snapshot --quiet --syslog --label=daily --keep=31 //
|
|
||||||
|
# Only call zfs-auto-snapshot if it's available
|
||||||
|
which zfs-auto-snapshot > /dev/null && \
|
||||||
|
exec zfs-auto-snapshot --quiet --syslog --label=daily --keep=31 //
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
PATH="/usr/bin:/bin:/usr/sbin:/sbin"
|
PATH="/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
|
||||||
|
|
||||||
*/15 * * * * root zfs-auto-snapshot -q -g --label=frequent --keep=4 //
|
*/15 * * * * root which zfs-auto-snapshot > /dev/null && zfs-auto-snapshot --quiet --syslog --label=frequent --keep=4 //
|
||||||
|
@@ -1,2 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec zfs-auto-snapshot --quiet --syslog --label=hourly --keep=24 //
|
|
||||||
|
# Only call zfs-auto-snapshot if it's available
|
||||||
|
which zfs-auto-snapshot > /dev/null && \
|
||||||
|
exec zfs-auto-snapshot --quiet --syslog --label=hourly --keep=24 //
|
||||||
|
@@ -1,2 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec zfs-auto-snapshot --quiet --syslog --label=monthly --keep=12 //
|
|
||||||
|
# Only call zfs-auto-snapshot if it's available
|
||||||
|
which zfs-auto-snapshot > /dev/null && \
|
||||||
|
exec zfs-auto-snapshot --quiet --syslog --label=monthly --keep=12 //
|
||||||
|
@@ -1,2 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec zfs-auto-snapshot --quiet --syslog --label=weekly --keep=8 //
|
|
||||||
|
# Only call zfs-auto-snapshot if it's available
|
||||||
|
which zfs-auto-snapshot > /dev/null && \
|
||||||
|
exec zfs-auto-snapshot --quiet --syslog --label=weekly --keep=8 //
|
||||||
|
@@ -110,7 +110,7 @@ print_log () # level, message, ...
|
|||||||
;;
|
;;
|
||||||
(inf*)
|
(inf*)
|
||||||
# test -n "$opt_syslog" && logger -t "$opt_prefix" -p daemon.info $*
|
# test -n "$opt_syslog" && logger -t "$opt_prefix" -p daemon.info $*
|
||||||
test -n "$opt_verbose" && echo $*
|
test -z ${opt_quiet+x} && test -n "$opt_verbose" && echo $*
|
||||||
;;
|
;;
|
||||||
(deb*)
|
(deb*)
|
||||||
# test -n "$opt_syslog" && logger -t "$opt_prefix" -p daemon.debug $*
|
# test -n "$opt_syslog" && logger -t "$opt_prefix" -p daemon.debug $*
|
||||||
@@ -191,7 +191,7 @@ do_snapshots () # properties, flags, snapname, oldglob, [targets...]
|
|||||||
KEEP=$(( $KEEP - 1 ))
|
KEEP=$(( $KEEP - 1 ))
|
||||||
if [ "$KEEP" -le '0' ]
|
if [ "$KEEP" -le '0' ]
|
||||||
then
|
then
|
||||||
if do_run "zfs destroy $FLAGS '$jj'"
|
if do_run "zfs destroy -d $FLAGS '$jj'"
|
||||||
then
|
then
|
||||||
DESTRUCTION_COUNT=$(( $DESTRUCTION_COUNT + 1 ))
|
DESTRUCTION_COUNT=$(( $DESTRUCTION_COUNT + 1 ))
|
||||||
else
|
else
|
||||||
@@ -373,7 +373,11 @@ ZFS_LIST=$(env LC_ALL=C zfs list -H -t filesystem,volume -s name \
|
|||||||
|
|
||||||
if [ -n "$opt_fast_zfs_list" ]
|
if [ -n "$opt_fast_zfs_list" ]
|
||||||
then
|
then
|
||||||
SNAPSHOTS_OLD=$(env LC_ALL=C zfs list -H -t snapshot -o name -s name|grep $opt_prefix |awk '{ print substr( $0, length($0) - 14, length($0) ) " " $0}' |sort -r -k1,1 -k2,2|awk '{ print substr( $0, 17, length($0) )}') \
|
SNAPSHOTS_OLD=$(env LC_ALL=C zfs list -H -t snapshot -o name -s name | \
|
||||||
|
grep $opt_prefix | \
|
||||||
|
awk '{ print substr( $0, length($0) - 14, length($0) ) " " $0}' | \
|
||||||
|
sort -r -k1,1 -k2,2 | \
|
||||||
|
awk '{ print substr( $0, 17, length($0) )}') \
|
||||||
|| { print_log error "zfs list $?: $SNAPSHOTS_OLD"; exit 137; }
|
|| { print_log error "zfs list $?: $SNAPSHOTS_OLD"; exit 137; }
|
||||||
else
|
else
|
||||||
SNAPSHOTS_OLD=$(env LC_ALL=C zfs list -H -t snapshot -S creation -o name) \
|
SNAPSHOTS_OLD=$(env LC_ALL=C zfs list -H -t snapshot -S creation -o name) \
|
||||||
|
Reference in New Issue
Block a user