Skip to content

[WIP] Add support for systemd timers #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions files/timeshift.service
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions files/timeshift.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Hourly Timeshift check for snapshots
Documentation=man:timeshift(1)

[Timer]
OnCalendar=hourly
Persistent=true

[Install]
WantedBy=timers.target
8 changes: 8 additions & 0 deletions src/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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"