.
sanoid-2.0.3/README.md 0000664 0000000 0000000 00000025616 13557162206 0014271 0 ustar 00root root 0000000 0000000 
Sanoid is a policy-driven snapshot management tool for ZFS filesystems. When combined with the Linux KVM hypervisor, you can use it to make your systems functionally immortal.

(Real time demo: rolling back a full-scale cryptomalware infection in seconds!)
More prosaically, you can use Sanoid to create, automatically thin, and monitor snapshots and pool health from a single eminently human-readable TOML config file at /etc/sanoid/sanoid.conf. (Sanoid also requires a "defaults" file located at /etc/sanoid/sanoid.defaults.conf, which is not user-editable.) A typical Sanoid system would have a single cron job:
```
* * * * * TZ=UTC /usr/local/bin/sanoid --cron
```
`Note`: Using UTC as timezone is recommend to prevent problems with daylight saving times
And its /etc/sanoid/sanoid.conf might look something like this:
```
[data/home]
use_template = production
[data/images]
use_template = production
recursive = yes
process_children_only = yes
[data/images/win7]
hourly = 4
#############################
# templates below this line #
#############################
[template_production]
frequently = 0
hourly = 36
daily = 30
monthly = 3
yearly = 0
autosnap = yes
autoprune = yes
```
Which would be enough to tell sanoid to take and keep 36 hourly snapshots, 30 dailies, 3 monthlies, and no yearlies for all datasets under data/images (but not data/images itself, since process_children_only is set). Except in the case of data/images/win7, which follows the same template (since it's a child of data/images) but only keeps 4 hourlies for whatever reason.
##### Sanoid Command Line Options
+ --cron
This will process your sanoid.conf file, create snapshots, then purge expired ones.
+ --configdir
Specify a location for the config file named sanoid.conf. Defaults to /etc/sanoid
+ --take-snapshots
This will process your sanoid.conf file, create snapshots, but it will NOT purge expired ones. (Note that snapshots taken are atomic in an individual dataset context, not a global context - snapshots of pool/dataset1 and pool/dataset2 will each be internally consistent and atomic, but one may be a few filesystem transactions "newer" than the other.)
+ --prune-snapshots
This will process your sanoid.conf file, it will NOT create snapshots, but it will purge expired ones.
+ --force-prune
Purges expired snapshots even if a send/recv is in progress
+ --monitor-snapshots
This option is designed to be run by a Nagios monitoring system. It reports on the health of your snapshots.
+ --monitor-health
This option is designed to be run by a Nagios monitoring system. It reports on the health of the zpool your filesystems are on. It only monitors filesystems that are configured in the sanoid.conf file.
+ --monitor-capacity
This option is designed to be run by a Nagios monitoring system. It reports on the capacity of the zpool your filesystems are on. It only monitors pools that are configured in the sanoid.conf file.
+ --force-update
This clears out sanoid's zfs snapshot listing cache. This is normally not needed.
+ --version
This prints the version number, and exits.
+ --quiet
Supress non-error output.
+ --verbose
This prints additional information during the sanoid run.
+ --debug
This prints out quite alot of additional information during a sanoid run, and is normally not needed.
+ --readonly
Skip creation/deletion of snapshots (Simulate).
+ --help
Show help message.
----------
# Syncoid
Sanoid also includes a replication tool, syncoid, which facilitates the asynchronous incremental replication of ZFS filesystems. A typical syncoid command might look like this:
```
syncoid data/images/vm backup/images/vm
```
Which would replicate the specified ZFS filesystem (aka dataset) from the data pool to the backup pool on the local system, or
```
syncoid data/images/vm root@remotehost:backup/images/vm
```
Which would push-replicate the specified ZFS filesystem from the local host to remotehost over an SSH tunnel, or
```
syncoid root@remotehost:data/images/vm backup/images/vm
```
Which would pull-replicate the filesystem from the remote host to the local system over an SSH tunnel.
Syncoid supports recursive replication (replication of a dataset and all its child datasets) and uses mbuffer buffering, lzop compression, and pv progress bars if the utilities are available on the systems used.
If ZFS supports resumeable send/receive streams on both the source and target those will be enabled as default.
As of 1.4.18, syncoid also automatically supports and enables resume of interrupted replication when both source and target support this feature.
##### Syncoid Dataset Properties
+ syncoid:sync
Available values:
+ `true` (default if unset)
This dataset will be synchronised to all hosts.
+ `false`
This dataset will not be synchronised to any hosts - it will be skipped. This can be useful for preventing certain datasets from being transferred when recursively handling a tree.
+ `host1,host2,...`
A comma separated list of hosts. This dataset will only be synchronised by hosts listed in the property.
_Note_: this check is performed by the host running `syncoid`, thus the local hostname must be present for inclusion during a push operation // the remote hostname must be present for a pull.
_Note_: this will also prevent syncoid from handling the dataset if given explicitly on the command line.
_Note_: syncing a child of a no-sync dataset will currently result in a critical error.
_Note_: empty properties will be handled as if they were unset.
##### Syncoid Command Line Options
+ [source]
This is the source dataset. It can be either local or remote.
+ [destination]
This is the destination dataset. It can be either local or remote.
+ --identifier=
Adds the given identifier to the snapshot name after "syncoid_" prefix and before the hostname. This enables the use case of reliable replication to multiple targets from the same host. The following chars are allowed: a-z, A-Z, 0-9, _, -, : and . .
+ -r --recursive
This will also transfer child datasets.
+ --skip-parent
This will skip the syncing of the parent dataset. Does nothing without '--recursive' option.
+ --compress
Currently accepted options: gzip, pigz-fast, pigz-slow, zstd-fast, zstd-slow, lz4, xz, lzo (default) & none. If the selected compression method is unavailable on the source and destination, no compression will be used.
+ --source-bwlimit
This is the bandwidth limit in bytes (kbytes, mbytes, etc) per second imposed upon the source. This is mainly used if the target does not have mbuffer installed, but bandwidth limits are desired.
+ --target-bw-limit
This is the bandwidth limit in bytes (kbytes, mbytesm etc) per second imposed upon the target. This is mainly used if the source does not have mbuffer installed, but bandwidth limits are desired.
+ --no-command-checks
Does not check the existence of commands before attempting the transfer, providing administrators a way to run the tool with minimal overhead and maximum speed, at risk of potentially failed replication, or other possible edge cases. It assumes all programs are available, and should not be used in most situations. This is an not an officially supported run mode.
+ --no-stream
This argument tells syncoid to use -i incrementals, not -I. This updates the target with the newest snapshot from the source, without replicating the intermediate snapshots in between. (If used for an initial synchronization, will do a full replication from newest snapshot and exit immediately, rather than starting with the oldest and then doing an immediate -i to the newest.)
+ --no-sync-snap
This argument tells syncoid to restrict itself to existing snapshots, instead of creating a semi-ephemeral syncoid snapshot at execution time. Especially useful in multi-target (A->B, A->C) replication schemes, where you might otherwise accumulate a large number of foreign syncoid snapshots.
+ --create-bookmark
This argument tells syncoid to create a zfs bookmark for the newest snapshot after it got replicated successfully. The bookmark name will be equal to the snapshot name. Only works in combination with the --no-sync-snap option. This can be very useful for irregular replication where the last matching snapshot on the source was already deleted but the bookmark remains so a replication is still possible.
+ --no-clone-rollback
Do not rollback clones on target
+ --no-rollback
Do not rollback anything (clones or snapshots) on target host
+ --exclude=REGEX
The given regular expression will be matched against all datasets which would be synced by this run and excludes them. This argument can be specified multiple times.
+ --no-resume
This argument tells syncoid to not use resumeable zfs send/receive streams.
+ --force-delete
Remove target datasets recursively (WARNING: this will also affect child datasets with matching snapshots/bookmarks), if there are no matching snapshots/bookmarks.
+ --no-clone-handling
This argument tells syncoid to not recreate clones on the targe on initial sync and doing a normal replication instead.
+ --dumpsnaps
This prints a list of snapshots during the run.
+ --no-privilege-elevation
Bypass the root check and assume syncoid has the necessary permissions (for use with ZFS permission delegation).
+ --sshport
Allow sync to/from boxes running SSH on non-standard ports.
+ --sshcipher
Instruct ssh to use a particular cipher set.
+ --sshoption
Passes option to ssh. This argument can be specified multiple times.
+ --sshkey
Use specified identity file as per ssh -i.
+ --quiet
Supress non-error output.
+ --debug
This prints out quite alot of additional information during a sanoid run, and is normally not needed.
+ --help
Show help message.
+ --version
Print the version and exit.
+ --monitor-version
This doesn't do anything right now.
Note that the sync snapshots syncoid creates are not atomic in a global context: sync snapshots of pool/dataset1 and pool/dataset2 will each be internally consistent, but one may be a few filesystem transactions "newer" than the other. (This does not affect the consistency of snapshots already taken in other ways, which syncoid replicates in the overall stream unless --no-stream is specified. So if you want to manually zfs snapshot -R pool@1 before replicating with syncoid, the global atomicity of pool/dataset1@1 and pool/dataset2@1 will still be intact.)
sanoid-2.0.3/VERSION 0000664 0000000 0000000 00000000006 13557162206 0014044 0 ustar 00root root 0000000 0000000 2.0.3
sanoid-2.0.3/findoid 0000775 0000000 0000000 00000011166 13557162206 0014347 0 ustar 00root root 0000000 0000000 #!/usr/bin/perl
# this software is licensed for use under the Free Software Foundation's GPL v3.0 license, as retrieved
# from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this
# project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE.
use strict;
use warnings;
my $zfs = '/sbin/zfs';
my %args = getargs(@ARGV);
my $progversion = '1.4.7';
if ($args{'version'}) { print "$progversion\n"; exit 0; }
my $dataset = getdataset($args{'path'});
my %versions = getversions($args{'path'}, $dataset);
foreach my $version (sort { $versions{$a}{'mtime'} <=> $versions{$b}{'mtime'} } keys %versions) {
my $disptime = localtime($versions{$version}{'mtime'});
my $dispsize = humansize($versions{$version}{'size'});
print "$disptime\t$dispsize\t$version\n";
}
exit 0;
###################################################################
###################################################################
###################################################################
sub humansize {
my ($rawsize) = @_;
my $humansize;
if ($rawsize > 1024*1024*1024) {
$humansize = sprintf("%.1f",$rawsize/1024/1024/1024) . ' GB';
} elsif ($rawsize > 1024*1024) {
$humansize = sprintf("%.1f",$rawsize/1024/1024) . ' MB';
} elsif ($rawsize > 255) {
$humansize = sprintf("%.1f",$rawsize/1024) . ' KB';
} else {
$humansize = $rawsize . ' Bytes';
}
return $humansize;
}
sub getversions {
my ($path, $dataset) = @_;
my @snaps = findsnaps($dataset, $args{'path'});
my $snappath = '.zfs/snapshot';
my $relpath = $path;
$relpath =~ s/^$dataset\///;
my %versions;
foreach my $snap (@snaps) {
my $filename = "$dataset/$snappath/$snap/$relpath";
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($filename);
# only push to the $versions hash if this size and mtime aren't already present (simple dedupe)
my $duplicate = 0;
foreach my $version (keys %versions) {
if ($versions{$version}{'size'} eq $size && $versions{$version}{'mtime'} eq $mtime) {
$duplicate = 1;
}
}
if (! $duplicate) {
$versions{$filename}{'size'} = $size;
$versions{$filename}{'mtime'} = $mtime;
}
}
return %versions;
}
sub findsnaps {
my ($dataset, $path) = @_;
my $snappath = '.zfs/snapshot';
my $relpath = $path;
$relpath =~ s/^$dataset//;
my @snaps;
opendir (my $dh, "$dataset/$snappath");
while (my $dir=(readdir $dh)) {
if ($dir ne '.' && $dir ne '..') { push @snaps, $dir; }
}
closedir $dh;
return @snaps;
}
sub getdataset {
my ($path) = @_;
open FH, "$zfs list -Ho mountpoint |";
my @datasets = ;
close FH;
my @matchingdatasets;
foreach my $dataset (@datasets) {
chomp $dataset;
if ( $path =~ /^$dataset/ ) { push @matchingdatasets, $dataset; }
}
my $bestmatch = '';
foreach my $dataset (@matchingdatasets) {
if ( length $dataset > length $bestmatch ) { $bestmatch = $dataset; }
}
return $bestmatch;
}
sub getargs {
my @args = @_;
my %args;
my %novaluearg;
my %validarg;
push my @validargs, ('debug','version');
foreach my $item (@validargs) { $validarg{$item} = 1; }
push my @novalueargs, ('debug','version');
foreach my $item (@novalueargs) { $novaluearg{$item} = 1; }
while (my $rawarg = shift(@args)) {
my $arg = $rawarg;
my $argvalue;
if ($rawarg =~ /=/) {
# user specified the value for a CLI argument with =
# instead of with blank space. separate appropriately.
$argvalue = $arg;
$arg =~ s/=.*$//;
$argvalue =~ s/^.*=//;
}
if ($rawarg =~ /^--/) {
# doubledash arg
$arg =~ s/^--//;
if (! $validarg{$arg}) { die "ERROR: don't understand argument $rawarg.\n"; }
if ($novaluearg{$arg}) {
$args{$arg} = 1;
} else {
# if this CLI arg takes a user-specified value and
# we don't already have it, then the user must have
# specified with a space, so pull in the next value
# from the array as this value rather than as the
# next argument.
if ($argvalue eq '') { $argvalue = shift(@args); }
$args{$arg} = $argvalue;
}
} elsif ($arg =~ /^-/) {
# singledash arg
$arg =~ s/^-//;
if (! $validarg{$arg}) { die "ERROR: don't understand argument $rawarg.\n"; }
if ($novaluearg{$arg}) {
$args{$arg} = 1;
} else {
# if this CLI arg takes a user-specified value and
# we don't already have it, then the user must have
# specified with a space, so pull in the next value
# from the array as this value rather than as the
# next argument.
if ($argvalue eq '') { $argvalue = shift(@args); }
$args{$arg} = $argvalue;
}
} else {
# bare arg
$args{'path'} = $arg;
}
}
return %args;
}
sanoid-2.0.3/packages/ 0000775 0000000 0000000 00000000000 13557162206 0014556 5 ustar 00root root 0000000 0000000 sanoid-2.0.3/packages/debian/ 0000775 0000000 0000000 00000000000 13557162206 0016000 5 ustar 00root root 0000000 0000000 sanoid-2.0.3/packages/debian/.gitignore 0000664 0000000 0000000 00000000117 13557162206 0017767 0 ustar 00root root 0000000 0000000 *.debhelper
*.debhelper.log
*.substvars
debhelper-build-stamp
files
sanoid
tmp
sanoid-2.0.3/packages/debian/TODO 0000664 0000000 0000000 00000001170 13557162206 0016467 0 ustar 00root root 0000000 0000000 - This package needs to be a 3.0 (quilt) format, not 3.0 (native).
- Fix the changelog
- Move the packaging out to a separate repository, or at a minimum,
a separate branch.
- Provide an extended description in debian/control
- Figure out a plan for sanoid.defaults.conf. It is not supposed to be
edited, so it shouldn't be installed in /etc. At a minimum, install
it under /usr and make a symlink, but preferably patch sanoid to look
there directly.
- Man pages are necessary for all the utilities installed.
- With these, there is probably no need to ship README.md.
- Break out syncoid into a separate package?
sanoid-2.0.3/packages/debian/changelog 0000664 0000000 0000000 00000015274 13557162206 0017663 0 ustar 00root root 0000000 0000000 sanoid (2.0.3) unstable; urgency=medium
[sanoid] reverted DST handling and improved it as quickfix (@phreaker0)
-- Jim Salter Wed, 02 Oct 2019 17:00:00 +0100
sanoid (2.0.2) unstable; urgency=medium
[overall] documentation updates, new dependencies, small fixes, more warnings (@benyanke, @matveevandrey, @RulerOf, @klemens-u, @johnramsden, @danielewood, @g-a-c, @hartzell, @fryfrog, @phreaker0)
[syncoid] changed and simplified DST handling (@shodanshok)
[syncoid] reset partially resume state automatically (@phreaker0)
[syncoid] handle some zfs erros automatically by parsing the stderr outputs (@phreaker0)
[syncoid] fixed ordering of snapshots with the same creation timestamp (@phreaker0)
[syncoid] don't use hardcoded paths (@phreaker0)
[syncoid] fix for special setup with listsnapshots=on (@phreaker0)
[syncoid] check ssh connection on startup (@phreaker0)
[syncoid] fix edge case with initial send and no-stream option (@phreaker0)
[syncoid] fallback to normal replication if clone recreation fails (@phreaker0)
[packaging] ebuild for gentoo (@thehaven)
[syncoid] support for zfs bookmark creation (@phreaker0)
[syncoid] fixed bookmark edge cases (@phreaker0)
[syncoid] handle invalid dataset paths nicely (@phreaker0)
[syncoid] fixed resume support check to be zpool based (@phreaker0)
[sanoid] added hotspare template (@jimsalterjrs)
[syncoid] support for advanced zfs send/recv options (@clinta, @phreaker0)
[syncoid] option to change mbuffer size (@TerraTech)
[tests] fixes for FreeBSD (@phreaker0)
[sanoid] support for zfs recursion (@jMichaelA, @phreaker0)
[syncoid] fixed bookmark handling for volumens (@ppcontrib)
[sanoid] allow time units for monitoring warn/crit values (@phreaker0)
-- Jim Salter Fri, 20 Sep 2019 23:01:00 +0100
sanoid (2.0.1) unstable; urgency=medium
[sanoid] fixed broken monthly warn/critical monitoring values in default template (@jimsalterjrs)
[sanoid] flag to force pruning while filesystem is in an active zfs send/recv (@shodanshok)
[syncoid] flags to disable rollbacks (@shodanshok)
-- Jim Salter Fri, 14 Dec 2018 16:48:00 +0100
sanoid (2.0.0) unstable; urgency=medium
[overall] documentation updates, small fixes, more warnings (@sparky3387, @ljwobker, @phreaker0)
[syncoid] added force delete flag (@phreaker0)
[sanoid] removed sleeping between snapshot taking (@phreaker0)
[syncoid] added '--no-privilege-elevation' option to bypass root check (@lopsided98)
[sanoid] implemented weekly period (@phreaker0)
[syncoid] implemented support for zfs bookmarks as fallback (@phreaker0)
[sanoid] support for pre, post and prune snapshot scripts (@jouir, @darkbasic, @phreaker0)
[sanoid] ignore snapshots types that are set to 0 (@muff1nman)
[packaging] split snapshot taking/pruning into separate systemd units for debian package (@phreaker0)
[syncoid] replicate clones (@phreaker0)
[syncoid] added compression algorithms: lz4, xz (@spheenik, @phreaker0)
[sanoid] added option to defer pruning based on the available pool capacity (@phreaker0)
[sanoid] implemented frequent snapshots with configurable period (@phreaker0)
[syncoid] prevent a perl warning on systems which doesn't output estimated send size information (@phreaker0)
[packaging] dependency fixes (@rodgerd, mabushey)
[syncoid] implemented support for excluding children of a specific dataset (@phreaker0)
[sanoid] monitor-health command additionally checks vdev members for io and checksum errors (@phreaker0)
[syncoid] added ability to skip datasets by a custom dataset property 'syncoid:no-sync' (@attie)
[syncoid] don't die on some critical replication errors, but continue with the remaining datasets (@phreaker0)
[syncoid] return a non zero exit code if there was a problem replicating datasets (@phreaker0)
[syncoid] make local source bwlimit work (@phreaker0)
[syncoid] fix 'resume support' detection on FreeBSD (@pit3k)
[sanoid] updated INSTALL with missing dependency
[sanoid] fixed monitor-health command for pools containing cache and log devices (@phreaker0)
[sanoid] quiet flag suppresses all info output (@martinvw)
[sanoid] check for empty lockfile which lead to sanoid failing on start (@jasonblewis)
[sanoid] added dst handling to prevent multiple invalid snapshots on time shift (@phreaker0)
[sanoid] cache improvements, makes sanoid much faster with a huge amount of datasets/snapshots (@phreaker0)
[sanoid] implemented monitor-capacity flag for checking zpool capacity limits (@phreaker0)
[syncoid] Added support for ZStandard compression.(@danielewood)
[syncoid] implemented support for excluding datasets from replication with regular expressions (@phreaker0)
[syncoid] correctly parse zfs column output, fixes resumeable send with datasets containing spaces (@phreaker0)
[syncoid] added option for using extra identification in the snapshot name for replication to multiple targets (@phreaker0)
[syncoid] added option for skipping the parent dataset in recursive replication (@phreaker0)
[syncoid] typos (@UnlawfulMonad, @jsavikko, @phreaker0)
[sanoid] use UTC by default in unit template and documentation (@phreaker0)
[syncoid] don't prune snapshots if instructed to not create them either (@phreaker0)
[syncoid] documented compatibility issues with (t)csh shells (@ecoutu)
-- Jim Salter Wed, 04 Dec 2018 18:10:00 -0400
sanoid (1.4.18) unstable; urgency=medium
implemented special character handling and support of ZFS resume/receive tokens by default in syncoid,
thank you @phreaker0!
-- Jim Salter Wed, 25 Apr 2018 16:24:00 -0400
sanoid (1.4.17) unstable; urgency=medium
changed die to warn when unexpectedly unable to remove a snapshot - this
allows sanoid to continue taking/removing other snapshots not affected by
whatever lock prevented the first from being taken or removed
-- Jim Salter Wed, 8 Nov 2017 15:25:00 -0400
sanoid (1.4.16) unstable; urgency=medium
* merged @hrast01's extended fix to support -o option1=val,option2=val passthrough to SSH. merged @JakobR's
* off-by-one fix to stop unnecessary extra snapshots being taken under certain conditions. merged @stardude900's
* update to INSTALL for FreeBSD users re:symlinks. Implemented @LordAro's update to change DIE to WARN when
* encountering a dataset with no snapshots and --no-sync-snap set during recursive replication. Implemented
* @LordAro's update to sanoid.conf to add an ignore template which does not snap, prune, or monitor.
-- Jim Salter Wed, 9 Aug 2017 12:28:49 -0400
sanoid-2.0.3/packages/debian/compat 0000664 0000000 0000000 00000000003 13557162206 0017177 0 ustar 00root root 0000000 0000000 10
sanoid-2.0.3/packages/debian/control 0000664 0000000 0000000 00000001253 13557162206 0017404 0 ustar 00root root 0000000 0000000 Source: sanoid
Section: utils
Priority: optional
Maintainer: Jim Salter
Build-Depends: debhelper (>= 10)
Standards-Version: 4.1.2
Homepage: https://github.com/jimsalterjrs/sanoid
Vcs-Git: https://github.com/jimsalterjrs/sanoid.git
Vcs-Browser: https://github.com/jimsalterjrs/sanoid
Package: sanoid
Architecture: all
Depends: libcapture-tiny-perl,
libconfig-inifiles-perl,
systemd,
zfsutils-linux | zfs,
${misc:Depends},
${perl:Depends}
Recommends: gzip,
lzop,
mbuffer,
openssh-client | ssh-client,
pv
Description: Policy-driven snapshot management and replication tools
sanoid-2.0.3/packages/debian/copyright 0000664 0000000 0000000 00000002156 13557162206 0017737 0 ustar 00root root 0000000 0000000 Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: sanoid
Source: https://github.com/jimsalterjrs/sanoid
Files: *
Copyright: 2017 Jim Salter
License: GPL-3.0+
Files: debian/*
Copyright: 2017 Jim Salter
2017 Richard Laager
License: GPL-3.0+
License: GPL-3.0+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
sanoid-2.0.3/packages/debian/rules 0000775 0000000 0000000 00000001605 13557162206 0017062 0 ustar 00root root 0000000 0000000 #!/usr/bin/make -f
# See debhelper(7) for more info
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
%:
dh $@
DESTDIR = $(CURDIR)/debian/sanoid
override_dh_auto_install:
install -d $(DESTDIR)/etc/sanoid
install -m 664 sanoid.defaults.conf $(DESTDIR)/etc/sanoid
install -d $(DESTDIR)/lib/systemd/system
install -m 664 debian/sanoid-prune.service debian/sanoid.timer \
$(DESTDIR)/lib/systemd/system
install -d $(DESTDIR)/usr/sbin
install -m 775 \
findoid sanoid sleepymutex syncoid \
$(DESTDIR)/usr/sbin
install -d $(DESTDIR)/usr/share/doc/sanoid
install -m 664 sanoid.conf \
$(DESTDIR)/usr/share/doc/sanoid/sanoid.conf.example
override_dh_installinit:
dh_installinit --noscripts
override_dh_systemd_enable:
dh_systemd_enable sanoid.timer
dh_systemd_enable sanoid-prune.service
override_dh_systemd_start:
dh_systemd_start sanoid.timer
sanoid-2.0.3/packages/debian/sanoid-prune.service 0000664 0000000 0000000 00000000413 13557162206 0021764 0 ustar 00root root 0000000 0000000 [Unit]
Description=Cleanup ZFS Pool
Requires=zfs.target
After=zfs.target sanoid.service
ConditionFileNotEmpty=/etc/sanoid/sanoid.conf
[Service]
Environment=TZ=UTC
Type=oneshot
ExecStart=/usr/sbin/sanoid --prune-snapshots --verbose
[Install]
WantedBy=sanoid.service
sanoid-2.0.3/packages/debian/sanoid.README.Debian 0000664 0000000 0000000 00000000134 13557162206 0021313 0 ustar 00root root 0000000 0000000 To start, copy the example config file in /usr/share/doc/sanoid to
/etc/sanoid/sanoid.conf.
sanoid-2.0.3/packages/debian/sanoid.docs 0000664 0000000 0000000 00000000012 13557162206 0020120 0 ustar 00root root 0000000 0000000 README.md
sanoid-2.0.3/packages/debian/sanoid.service 0000664 0000000 0000000 00000000420 13557162206 0020633 0 ustar 00root root 0000000 0000000 [Unit]
Description=Snapshot ZFS Pool
Requires=zfs.target
After=zfs.target
Wants=sanoid-prune.service
Before=sanoid-prune.service
ConditionFileNotEmpty=/etc/sanoid/sanoid.conf
[Service]
Environment=TZ=UTC
Type=oneshot
ExecStart=/usr/sbin/sanoid --take-snapshots --verbose
sanoid-2.0.3/packages/debian/sanoid.timer 0000664 0000000 0000000 00000000174 13557162206 0020321 0 ustar 00root root 0000000 0000000 [Unit]
Description=Run Sanoid Every 15 Minutes
[Timer]
OnCalendar=*:0/15
Persistent=true
[Install]
WantedBy=timers.target
sanoid-2.0.3/packages/debian/source/ 0000775 0000000 0000000 00000000000 13557162206 0017300 5 ustar 00root root 0000000 0000000 sanoid-2.0.3/packages/debian/source/format 0000664 0000000 0000000 00000000015 13557162206 0020507 0 ustar 00root root 0000000 0000000 3.0 (native)
sanoid-2.0.3/packages/gentoo/ 0000775 0000000 0000000 00000000000 13557162206 0016051 5 ustar 00root root 0000000 0000000 sanoid-2.0.3/packages/gentoo/sys-fs/ 0000775 0000000 0000000 00000000000 13557162206 0017275 5 ustar 00root root 0000000 0000000 sanoid-2.0.3/packages/gentoo/sys-fs/sanoid/ 0000775 0000000 0000000 00000000000 13557162206 0020552 5 ustar 00root root 0000000 0000000 sanoid-2.0.3/packages/gentoo/sys-fs/sanoid/Manifest 0000664 0000000 0000000 00000002064 13557162206 0022245 0 ustar 00root root 0000000 0000000 AUX sanoid.cron 45 BLAKE2B 3f6294bbbf485dc21a565cd2c8da05a42fb21cdaabdf872a21500f1a7338786c60d4a1fd188bbf81ce85f06a376db16998740996f47c049707a5109bdf02c052 SHA512 7676b32f21e517e8c84a097c7934b54097cf2122852098ea756093ece242125da3f6ca756a6fbb82fc348f84b94bfd61639e86e0bfa4bbe7abf94a8a4c551419
DIST sanoid-2.0.2.tar.gz 115797 BLAKE2B d00a038062df3dd8e77d3758c7b80ed6da0bac4931fb6df6adb72eeddb839c63d5129e0a281948a483d02165dad5a8505e1a55dc851360d3b366371038908142 SHA512 73e3d25dbdd58a78ffc4384584304e7230c5f31a660ce6d2a9b9d52a92a3796f1bc25ae865dbc74ce586cbd6169dbb038340f4a28e097e77ab3eb192b15773db
EBUILD sanoid-2.0.2.ebuild 796 BLAKE2B f3d633289d66c60fd26cb7731bc6b63533019f527aaec9ca8e5c0e748542d391153dbb55b17b8c981ca4fa4ae1fc8dc202b5480c13736fca250940b3b5ebb793 SHA512 d0143680c029ffe4ac37d97a979ed51527b4b8dd263d0c57e43a4650bf8a9bb8
EBUILD sanoid-9999.ebuild 776 BLAKE2B 416b8d04a9e5a84bce46d2a6f88eaefe03804944c03bc7f49b7a5b284b844212a6204402db3de3afa5d9c0545125d2631e7231c8cb2a3537bdcb10ea1be46b6a SHA512 98d8a30a13e75d7847ae9d60797d54078465bf75c6c6d9b6fd86075e342c0374
sanoid-2.0.3/packages/gentoo/sys-fs/sanoid/files/ 0000775 0000000 0000000 00000000000 13557162206 0021654 5 ustar 00root root 0000000 0000000 sanoid-2.0.3/packages/gentoo/sys-fs/sanoid/files/sanoid.cron 0000664 0000000 0000000 00000000055 13557162206 0024014 0 ustar 00root root 0000000 0000000 * * * * * root TZ=UTC /usr/bin/sanoid --cron
sanoid-2.0.3/packages/gentoo/sys-fs/sanoid/sanoid-2.0.2.ebuild 0000664 0000000 0000000 00000001434 13557162206 0023654 0 ustar 00root root 0000000 0000000 # Copyright 2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
DESCRIPTION="Policy-driven snapshot management and replication tools for ZFS"
HOMEPAGE="https://github.com/jimsalterjrs/sanoid"
SRC_URI="https://github.com/jimsalterjrs/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-3.0"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE=""
DEPEND="app-arch/lzop
dev-perl/Config-IniFiles
dev-perl/Capture-Tiny
sys-apps/pv
sys-block/mbuffer
virtual/perl-Data-Dumper"
RDEPEND="${DEPEND}"
BDEPEND=""
DOCS=( README.md )
src_install() {
dobin findoid
dobin sanoid
dobin sleepymutex
dobin syncoid
keepdir /etc/${PN}
insinto /etc/${PN}
doins sanoid.conf
doins sanoid.defaults.conf
insinto /etc/cron.d
newins "${FILESDIR}/${PN}.cron" ${PN}
}
sanoid-2.0.3/packages/gentoo/sys-fs/sanoid/sanoid-9999.ebuild 0000664 0000000 0000000 00000001410 13557162206 0023632 0 ustar 00root root 0000000 0000000 # Copyright 2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EGIT_REPO_URI="https://github.com/jimsalterjrs/${PN}.git"
inherit git-r3
DESCRIPTION="Policy-driven snapshot management and replication tools for ZFS"
HOMEPAGE="https://github.com/jimsalterjrs/sanoid"
LICENSE="GPL-3.0"
SLOT="0"
KEYWORDS="**"
IUSE=""
DEPEND="app-arch/lzop
dev-perl/Config-IniFiles
dev-perl/Capture-Tiny
sys-apps/pv
sys-block/mbuffer
virtual/perl-Data-Dumper"
RDEPEND="${DEPEND}"
BDEPEND=""
DOCS=( README.md )
src_install() {
dobin findoid
dobin sanoid
dobin sleepymutex
dobin syncoid
keepdir /etc/${PN}
insinto /etc/${PN}
doins sanoid.conf
doins sanoid.defaults.conf
insinto /etc/cron.d
newins "${FILESDIR}/${PN}.cron" ${PN}
}
sanoid-2.0.3/packages/rhel/ 0000775 0000000 0000000 00000000000 13557162206 0015510 5 ustar 00root root 0000000 0000000 sanoid-2.0.3/packages/rhel/sanoid-1.4.18.tar.gz 0000664 0000000 0000000 00000131165 13557162206 0020652 0 ustar 00root root 0000000 0000000 [ms6pr)Iu+VwVl֞VvYfWWg\<<
H\ݭC2@PȊy[(3Ç|nOgGG}vx4;br:dU7sbyx<>HfG`i:,M8>>zt8K2|$p>e[@L8m?}yz\/E^uiF([DQŵ2ʓ+۔eQժH__Jf'֪.V:jQN&ɕ1l8PSczR.+t5}0,\7_@p:uUY\5~ c?y&/Tz]`H<*+VY:E^h]MdnmƪsEi*KbKaeTkJ0ZJbsb
^T^oZ늻|"[Og;V3hzTM_G}wUF˪hKz9n'c*ovZ=i:oFEꢄ"sQUS@
DT:B[4~4v6emq˫*2WZwL5VW95,l{䢨Ӫry}ggo.<`t%0*V7^@{1Fy1yI##aMeiҕ.3Gta{t6R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