From 85c70b41cb831b1690c98a48a29225f1505106c9 Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Fri, 23 Aug 2019 09:59:59 +0200 Subject: [PATCH] Add systemd timer to sync pass database with git --- dotfiles/systemd.org | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/dotfiles/systemd.org b/dotfiles/systemd.org index bea7b21..e2adf38 100644 --- a/dotfiles/systemd.org +++ b/dotfiles/systemd.org @@ -1,5 +1,57 @@ #+TITLE: Systemd +* Pass Git +** Service + :PROPERTIES: + :header-args: :tangle ~/.config/systemd/user/passgit.service + :header-args+: :comments both :mkdirp yes + :END: + +#+BEGIN_SRC conf + [Unit] + Description=Sync Passwords every day + RefuseManualStart=no + RefuseManualStop=yes + + [Service] + Type=oneshot + ExecStart=%h/scripts/pass_git_sync.sh +#+END_SRC + +** Timer + :PROPERTIES: + :header-args: :tangle ~/.config/systemd/user/passgit.timer + :header-args+: :comments both :mkdirp yes + :END: + +#+BEGIN_SRC conf + [Unit] + Description=Sync Passwords every day + RefuseManualStart=no + RefuseManualStop=no + Wants=network-online.target + After=network.target network-online.target dbus.socket + + [Timer] + OnCalendar=*-*-* 17:00:00 + Persistent=true + Unit=passgit.service + + [Install] + WantedBy=default.target +#+END_SRC + +** Script + :PROPERTIES: + :header-args: :tangle ~/scripts/pass_git_sync.sh + :header-args+: :comments both :mkdirp yes + :header-args+: :shebang "#!/usr/bin/env bash" + :END: + +#+begin_src bash + pass git pull --rebase && pass git push +#+end_src + * Buku Git ** Service :PROPERTIES: