From 9968962bd0ea2f6c47c01e717027766065377b88 Mon Sep 17 00:00:00 2001 From: earnest ma Date: Thu, 30 Dec 2021 14:39:43 -0500 Subject: [PATCH] add systemd user files --- shell_common/.config/shell_common/aliases.sh | 1 + systemd/.config/systemd/user/.gitignore | 1 + systemd/.config/systemd/user/restic-backup.service | 7 +++++++ systemd/.config/systemd/user/restic-backup.timer | 10 ++++++++++ .../.config/systemd/user/restic-maintenance.service | 6 ++++++ systemd/.config/systemd/user/restic-maintenance.timer | 9 +++++++++ systemd/.config/systemd/user/systemd-notify@.service | 6 ++++++ systemd/.config/systemd/user/uxplay.service | 9 +++++++++ 8 files changed, 49 insertions(+) create mode 100644 systemd/.config/systemd/user/.gitignore create mode 100644 systemd/.config/systemd/user/restic-backup.service create mode 100644 systemd/.config/systemd/user/restic-backup.timer create mode 100644 systemd/.config/systemd/user/restic-maintenance.service create mode 100644 systemd/.config/systemd/user/restic-maintenance.timer create mode 100644 systemd/.config/systemd/user/systemd-notify@.service create mode 100644 systemd/.config/systemd/user/uxplay.service diff --git a/shell_common/.config/shell_common/aliases.sh b/shell_common/.config/shell_common/aliases.sh index fefa4b2..ee6237c 100644 --- a/shell_common/.config/shell_common/aliases.sh +++ b/shell_common/.config/shell_common/aliases.sh @@ -1,3 +1,4 @@ +alias usysctl='systemctl --user' # From https://mastodon.xyz/@CarlCravens/105758509287927276 alias clear='clear; tput cup $LINES 0' diff --git a/systemd/.config/systemd/user/.gitignore b/systemd/.config/systemd/user/.gitignore new file mode 100644 index 0000000..94f49d6 --- /dev/null +++ b/systemd/.config/systemd/user/.gitignore @@ -0,0 +1 @@ +timers.target.wants diff --git a/systemd/.config/systemd/user/restic-backup.service b/systemd/.config/systemd/user/restic-backup.service new file mode 100644 index 0000000..df2175c --- /dev/null +++ b/systemd/.config/systemd/user/restic-backup.service @@ -0,0 +1,7 @@ +[Unit] +Description=Restic backup service +OnFailure=systemd-notify@%n.service + +[Service] +Type=oneshot +ExecStart=/home/earne/.dotfiles/.restic/restic-do backup diff --git a/systemd/.config/systemd/user/restic-backup.timer b/systemd/.config/systemd/user/restic-backup.timer new file mode 100644 index 0000000..55c99fb --- /dev/null +++ b/systemd/.config/systemd/user/restic-backup.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Daily restic backup + +[Timer] +OnBootSec=6min +OnCalendar=*-*-* 21:00:00 +#Persistent=true + +[Install] +WantedBy=timers.target diff --git a/systemd/.config/systemd/user/restic-maintenance.service b/systemd/.config/systemd/user/restic-maintenance.service new file mode 100644 index 0000000..59f7c7f --- /dev/null +++ b/systemd/.config/systemd/user/restic-maintenance.service @@ -0,0 +1,6 @@ +[Unit] +Description=Restic backup maintenance - deleting and checking + +[Service] +Type=oneshot +ExecStart=/home/earne/.dotfiles/.restic/restic-do maint diff --git a/systemd/.config/systemd/user/restic-maintenance.timer b/systemd/.config/systemd/user/restic-maintenance.timer new file mode 100644 index 0000000..aea8427 --- /dev/null +++ b/systemd/.config/systemd/user/restic-maintenance.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Weekly restic backup maintenance - deleting and checking + +[Timer] +OnCalendar=weekly +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/systemd/.config/systemd/user/systemd-notify@.service b/systemd/.config/systemd/user/systemd-notify@.service new file mode 100644 index 0000000..2b27442 --- /dev/null +++ b/systemd/.config/systemd/user/systemd-notify@.service @@ -0,0 +1,6 @@ +[Unit] +Description=Notify shell about unit failure + +[Service] +Type=oneshot +ExecStart=notify-send --urgency=normal '%i failed.' 'See "systemctl --user status %i" and "journalctl --user-unit %i" for details.' diff --git a/systemd/.config/systemd/user/uxplay.service b/systemd/.config/systemd/user/uxplay.service new file mode 100644 index 0000000..6d15b5f --- /dev/null +++ b/systemd/.config/systemd/user/uxplay.service @@ -0,0 +1,9 @@ +[Unit] +Description=UxPlay + +[Service] +ExecStart=/home/earne/ghq/github.com/FDH2/UxPlay/uxplay + +[Install] +WantedBy=default.target +