diff options
-rwxr-xr-x | deploy.sh | 14 | ||||
-rw-r--r-- | systemd/backup.service | 7 | ||||
-rw-r--r-- | systemd/backup.timer | 9 |
3 files changed, 27 insertions, 3 deletions
@@ -26,8 +26,9 @@ xdata="${XDG_DATA_HOME:-${HOME}/.local/share}" xconfig="${XDG_CONFIG_HOME:-${HOME}/.config}" userbin="$HOME/.local/bin" +systemd="$xconfig/systemd/user" -mkdir -p "$xcache" "$xdata" "$xconfig" "$userbin" +mkdir -p "$xcache" "$xdata" "$xconfig" "$userbin" "$systemd" function link { src="$1" @@ -59,8 +60,7 @@ do done cd .. -# deploy to user binaries -mkdir -p "$userbin" +# deploy user executables cd bin for f in * do @@ -68,6 +68,14 @@ do done cd .. +# deploy systemd user units +cd systemd +for f in * +do + link "$(pwd)/${f}" "$systemd/${f}" +done +cd .. + autoload="$HOME/.vim/autoload" mkdir -p "$autoload" # install vim-plug diff --git a/systemd/backup.service b/systemd/backup.service new file mode 100644 index 0000000..c1adfde --- /dev/null +++ b/systemd/backup.service @@ -0,0 +1,7 @@ +[Unit] +Description=Backup with duplicity +After=network.target + +[Service] +Type=oneshot +ExecStart=bash ${HOME}/.local/bin/backup diff --git a/systemd/backup.timer b/systemd/backup.timer new file mode 100644 index 0000000..b7815d6 --- /dev/null +++ b/systemd/backup.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run backup every four hours + +[Timer] +OnCalendar=*-*-* 0/4:15 +Persistent=true + +[Install] +WantedBy=timers.target |