diff --git a/PKGBUILD b/PKGBUILD index 1b01af8..600d7c7 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # $Id: PKGBUILD 100043 2013-10-31 15:45:57Z kkeen $ # Maintainer: Kyle Keen pkgname=pacmatic -pkgver=20141006 +pkgver=20160415 pkgrel=1 pkgdesc="A pacman wrapper to avoid bricking your system and such other surprises." arch=('any') @@ -19,9 +19,11 @@ md5sums=('1fe11adaa39aae9d3146ddbc3808eb23' package() { cd "$srcdir/$pkgname" - install -Dm0755 pacmatic "$pkgdir/usr/bin/pacmatic" - install -Dm0755 cron-pacmatic "$pkgdir/usr/bin/cron-pacmatic" - install -Dm0644 pacmatic.1 "$pkgdir/usr/share/man/man1/pacmatic.1" - install -Dm0644 ../_pacmatic "$pkgdir/usr/share/zsh/site-functions/_pacmatic" + install -Dm0755 pacmatic "$pkgdir/usr/bin/pacmatic" + install -Dm0755 cron-pacmatic "$pkgdir/usr/bin/cron-pacmatic" + install -Dm0644 pacmatic.1 "$pkgdir/usr/share/man/man1/pacmatic.1" + install -Dm0644 ../_pacmatic "$pkgdir/usr/share/zsh/site-functions/_pacmatic" + install -Dm0644 pacmatic@.service "$pkgdir/usr/lib/systemd/system/pacmatic@.service" + install -Dm0644 pacmatic@.timer "$pkgdir/usr/lib/systemd/system/pacmatic@.timer" } diff --git a/cron-pacmatic b/cron-pacmatic index 6d37fec..a719f4c 100755 --- a/cron-pacmatic +++ b/cron-pacmatic @@ -36,5 +36,5 @@ if [[ -n $packages ]]; then echo "Recent ML chatter: $mail_counts" >> $mail_body echo "Pacman updates: $packages" >> $mail_body cat $mail_body |\ - mail -s "Updates available on $(hostname)" $1 + mail -# -s "Updates available on $(hostname)" $1 fi diff --git a/pacmatic.1 b/pacmatic.1 index 10c6d89..c2a445d 100644 --- a/pacmatic.1 +++ b/pacmatic.1 @@ -58,7 +58,11 @@ In case you want even higher levels of automation, there is a .Nm cron-pacmatic script. This script can be run periodically and will email you a summary of .Nm -output. +output. The +.Nm pacmatic@.timer +systemd unit is provided to schedule it. Enable it as +.Ic pacmatic@ Ns Em your\ex40mail.tld Ns Ic .timer +(with escaping). .Pp .Sh AUTHORS .An -nosplit diff --git a/pacmatic@.service b/pacmatic@.service new file mode 100644 index 0000000..eb68a7a --- /dev/null +++ b/pacmatic@.service @@ -0,0 +1,6 @@ +[Unit] +Description=Email list of pending updates to %I + +[Service] +Type=oneshot +ExecStart=/usr/bin/cron-pacmatic %I diff --git a/pacmatic@.timer b/pacmatic@.timer new file mode 100644 index 0000000..1dc0224 --- /dev/null +++ b/pacmatic@.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Email list of pending updates to %I timer + +[Timer] +OnCalendar=daily UTC + +[Install] +WantedBy=multi-user.target