diff --git a/files/timeshift.service b/files/timeshift.service new file mode 100644 index 00000000..c9891243 --- /dev/null +++ b/files/timeshift.service @@ -0,0 +1,15 @@ +[Unit] +Description=Timeshift Snapshots +Documentation=man:timeshift(1) + +[Service] +Type=simple +ExecStart=/usr/bin/timeshift --check --scripted + +CapabilityBoundingSet=CAP_DAC_OVERRIDE CAP_FOWNER CAP_CHOWN CAP_FSETID CAP_SETFCAP CAP_SYS_ADMIN CAP_SYS_MODULE CAP_IPC_LOCK CAP_SYS_NICE +LockPersonality=true +NoNewPrivileges=false +PrivateNetwork=true +ProtectHostname=true +RestrictAddressFamilies=AF_UNIX +RestrictRealtime=true diff --git a/files/timeshift.timer b/files/timeshift.timer new file mode 100644 index 00000000..a9b7125f --- /dev/null +++ b/files/timeshift.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Hourly Timeshift check for snapshots +Documentation=man:timeshift(1) + +[Timer] +OnCalendar=hourly +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/src/makefile b/src/makefile index 9e2ec66e..84562df4 100644 --- a/src/makefile +++ b/src/makefile @@ -121,6 +121,10 @@ install: mkdir -p "$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \ msgfmt --check --verbose -o "$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/${app_name}.mo" ../po/${app_name}-$$lang.po ; \ done + + # systemd timer and service file + install -m 0644 ../files/${app_name}.service "$(DESTDIR)/lib/systemd/system/" + install -m 0644 ../files/${app_name}.timer "$(DESTDIR)/lib/systemd/system/" uninstall: @@ -150,3 +154,7 @@ uninstall: # appdata rm -f "$(DESTDIR)$(sharedir)/appdata/${app_name}.appdata.xml" rm -f "$(DESTDIR)$(sharedir)/metainfo/${app_name}.appdata.xml" + + # systemd timer and service file + rm -f "$(DESTDIR)/lib/systemd/system/${app_name}.service" + rm -f "$(DESTDIR)/lib/systemd/system/${app_name}.timer"