diff --git a/rsnapshot-daily.timer b/rsnapshot-daily.timer new file mode 100644 index 0000000..cde795e --- /dev/null +++ b/rsnapshot-daily.timer @@ -0,0 +1,11 @@ +[Unit] +Description=rsnapshot daily backup + +[Timer] +# 2:00 is the clock time when to start it +OnCalendar=2:00 +Persistent=true +Unit=rsnapshot@daily.service + +[Install] +WantedBy=timers.target diff --git a/rsnapshot.spec b/rsnapshot.spec index 604f242..1b9ed77 100644 --- a/rsnapshot.spec +++ b/rsnapshot.spec @@ -1,6 +1,6 @@ Name: rsnapshot Version: 1.3.1 -Release: 2mamba +Release: 3mamba Summary: rsnapshot is a filesystem snapshot utility for making backups of local and remote systems Group: Applications/Archiving Vendor: openmamba @@ -8,6 +8,8 @@ Distribution: openmamba Packager: Fabio Giani URL: http://www.rsnapshot.org/ Source: http://www.rsnapshot.org/downloads/rsnapshot-%{version}.tar.gz +Source1: rsnapshot-daily.timer +Source2: rsnapshot@.service License: GPL BuildRoot: %{_tmppath}/%{name}-%{version}-root ## AUTOBUILDREQ-BEGIN @@ -36,20 +38,31 @@ Depending on your configuration, it is quite possible to set up in just a few mi [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %makeinstall +install -D -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/rsnapshot-daily.timer +install -D -m0644 %{SOURCE2} %{buildroot}%{_unitdir}/rsnapshot@.service + +cp %{buildroot}%{_sysconfdir}/rsnapshot.conf.default %{buildroot}%{_sysconfdir}/rsnapshot.conf + %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %files %defattr(-,root,root) -%{_mandir}/man1/rsnapshot.1.gz -%{_mandir}/man1/rsnapshot-diff.1.gz +%{_sysconfdir}/rsnapshot.conf.default +%attr(600,root,root) %config(noreplace) %{_sysconfdir}/rsnapshot.conf +%{_bindir}/rsnapshot +%{_bindir}/rsnapshot-diff +%{_unitdir}/rsnapshot-daily.timer +%{_unitdir}/rsnapshot@.service +%{_mandir}/man1/rsnapshot.1* +%{_mandir}/man1/rsnapshot-diff.1* %doc AUTHORS COPYING ChangeLog NEWS README TODO -%config %{_sysconfdir}/rsnapshot.conf.default -/usr/bin/rsnapshot -/usr/bin/rsnapshot-diff %changelog +* Sun Jun 07 2015 Silvan Calarco 1.3.1-3mamba +- provide systemd timer files + * Tue Jul 16 2013 Automatic Build System 1.3.1-2mamba - automatic rebuild by autodist diff --git a/rsnapshot@.service b/rsnapshot@.service new file mode 100644 index 0000000..0f66217 --- /dev/null +++ b/rsnapshot@.service @@ -0,0 +1,8 @@ +[Unit] +Description=rsnapshot (%I) backup + +[Service] +Type=oneshot +Nice=19 +IOSchedulingClass=3 +ExecStart=/usr/bin/rsnapshot %I