[pacman-contrib] [PATCH] Add a paccache systemd service and timer files
Isaac Good
isaacgood at gmail.com
Wed Nov 22 23:06:36 UTC 2017
src/Makefile.am | 7 +++++++
src/paccache.service | 6 ++++++
src/paccache.timer | 10 ++++++++++
3 files changed, 23 insertions(+)
create mode 100644 src/paccache.service
create mode 100644 src/paccache.timer
diff --git a/src/Makefile.am b/src/Makefile.am
index 3453b90..4151c7d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,6 +22,11 @@ vim_ftdetect__DATA = \
vim_syntax__DATA = \
vim/syntax/PKGBUILD.vim
+systemd_dir = ${libdir}/systemd/system
+
+systemd__DATA = \
+ paccache.service paccache.timer
+
BASHSCRIPTS = \
checkupdates \
paccache \
@@ -41,7 +46,9 @@ OURSCRIPTS = \
EXTRA_DIST = \
checkupdates.sh.in \
+ paccache.service \
paccache.sh.in \
+ paccache.timer \
pacdiff.sh.in \
paclist.sh.in \
paclog-pkglist.sh.in \
diff --git a/src/paccache.service b/src/paccache.service
new file mode 100644
index 0000000..bd86faf
--- /dev/null
+++ b/src/paccache.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Discard unused packages
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/paccache -r
diff --git a/src/paccache.timer b/src/paccache.timer
new file mode 100644
index 0000000..cd46bcb
--- /dev/null
+++ b/src/paccache.timer
@@ -0,0 +1,10 @@
+[Unit]
+Description=Discard unused packages weekly
+
+[Timer]
+OnCalendar=weekly
+AccuracySec=1h
+Persistent=true
+
+[Install]
+WantedBy=timers.target
--
2.15.0
More information about the pacman-contrib
mailing list