From c87279f899fc6f48103e6c8ed0a69edb980b52af Mon Sep 17 00:00:00 2001 From: "Thomas M. Lapp" Date: Tue, 8 Mar 2016 10:29:50 -0500 Subject: [PATCH 1/3] Added -sshkey arg for automated cron runs --- syncoid | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/syncoid b/syncoid index 8f67aaa..aff729a 100755 --- a/syncoid +++ b/syncoid @@ -35,7 +35,12 @@ my $mbufferoptions = '-q -s 128k -m 16M 2>/dev/null'; my $lscmd = '/bin/ls'; # figure out if source and/or target are remote. -$sshcmd = "$sshcmd $sshcipher"; +if ( $args{'sshkey'} ) { + $sshcmd = "$sshcmd $sshcipher -i $args{'sshkey'}"; +} +else { + $sshcmd = "$sshcmd $sshcipher"; +} my ($sourcehost,$sourcefs,$sourceisroot) = getssh($rawsourcefs); my ($targethost,$targetfs,$targetisroot) = getssh($rawtargetfs); @@ -243,7 +248,7 @@ sub getargs { my %novaluearg; my %validarg; - push my @validargs, ('debug','nocommandchecks','version','monitor-version','compress','source-bwlimit','target-bwlimit','dumpsnaps','recursive','r'); + push my @validargs, ('debug','nocommandchecks','version','monitor-version','compress','source-bwlimit','target-bwlimit','dumpsnaps','recursive','r','sshkey'); foreach my $item (@validargs) { $validarg{$item} = 1; } push my @novalueargs, ('debug','nocommandchecks','version','monitor-version','dumpsnaps','recursive','r'); foreach my $item (@novalueargs) { $novaluearg{$item} = 1; } From 50fb0d5733810311b64ea128dde1469cf11abd00 Mon Sep 17 00:00:00 2001 From: "Thomas M. Lapp" Date: Tue, 8 Mar 2016 10:46:36 -0500 Subject: [PATCH 2/3] Added spec file for rpm packaging. --- sanoid.spec | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 sanoid.spec diff --git a/sanoid.spec b/sanoid.spec new file mode 100644 index 0000000..9b6435a --- /dev/null +++ b/sanoid.spec @@ -0,0 +1,48 @@ +Name: sanoid +Version: 1.4.4 +Release: 1%{?dist} +BuildArch: noarch +Summary: A policy-driven snapshot management tool for ZFS filesystems + +Group: Applications/System +License: GPLv3 +URL: https://github.com/jimsalterjrs/sanoid +Source0: https://github.com/jimsalterjrs/sanoid/archive/sanoid-master.zip +Patch0: sanoid-syncoid-sshkey.patch +#BuildRequires: +Requires: perl + +%description +Sanoid is a policy-driven snapshot management +tool for ZFS filesystems. You can use Sanoid +to create, automatically thin, and monitor snapshots +and pool health from a single eminently +human-readable TOML config file. + +%prep +%setup -q -n sanoid-master +%patch0 -p1 + +%build + +%install +%{__install} -D -m 0644 sanoid.defaults.conf %{buildroot}/etc/sanoid/sanoid.defaults.conf +%{__install} -d %{buildroot}%{_sbindir} +%{__install} -m 0755 sanoid syncoid findoid sleepymutex %{buildroot}%{_sbindir} +%{__install} -D -m 0644 sanoid.conf %{buildroot}%{_docdir}/%{name}-%{version}/examples/sanoid.conf +echo "* * * * * root %{_sbindir}/sanoid --cron" > %{buildroot}%{_docdir}/%{name}-%{version}/examples/sanoid.cron + +%files +%doc CHANGELIST LICENSE VERSION README.md +%{_sbindir}/sanoid +%{_sbindir}/syncoid +%{_sbindir}/findoid +%{_sbindir}/sleepymutex +%dir %{_sysconfdir}/%{name} +%config %{_sysconfdir}/%{name}/sanoid.defaults.conf + + + +%changelog +* Sat Feb 13 2016 Tom Lapp - 1.4.4-1 +- Initial RPM Package From dd164bdd6816eb1435415e266f0a2a25ffda68b6 Mon Sep 17 00:00:00 2001 From: "Thomas M. Lapp" Date: Tue, 8 Mar 2016 10:48:40 -0500 Subject: [PATCH 3/3] Updated Change log --- sanoid.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanoid.spec b/sanoid.spec index 9b6435a..7f7900c 100644 --- a/sanoid.spec +++ b/sanoid.spec @@ -44,5 +44,5 @@ echo "* * * * * root %{_sbindir}/sanoid --cron" > %{buildroot}%{_docdir}/%{name} %changelog -* Sat Feb 13 2016 Tom Lapp - 1.4.4-1 +* Sat Feb 13 2016 Thomas M. Lapp - 1.4.4-1 - Initial RPM Package