Add systemd timer to sync pass database with git
This commit is contained in:
parent
ebe444ef2f
commit
85c70b41cb
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user