From de3e59db981f0be264e68c417d284b52964a3273 Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Wed, 29 Sep 2021 20:27:25 -0700 Subject: [PATCH] adding systemd files --- backup.sh.service | 11 +++++++++++ backup.sh.timer | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 backup.sh.service create mode 100644 backup.sh.timer diff --git a/backup.sh.service b/backup.sh.service new file mode 100644 index 0000000..e1ec543 --- /dev/null +++ b/backup.sh.service @@ -0,0 +1,11 @@ +[Unit] +Description=Run backup.sh as configured + +[Service] +Environment=XDG_CONFIG_HOME=/home/FIXME/.config +Environment=XDG_DATA_HOME=/home/FIXME/.local/share +Type=simple +ExecStart=/home/FIXME/.local/share/backup.sh/backup.sh backup FIXME + +[Install] +WantedBy=default.target diff --git a/backup.sh.timer b/backup.sh.timer new file mode 100644 index 0000000..ec28615 --- /dev/null +++ b/backup.sh.timer @@ -0,0 +1,17 @@ +[Unit] +Description=Run backup.sh at specified interval +RefuseManualStart=no # Allow manual starts +RefuseManualStop=no # Allow manual stops + +[Timer] +# Execute job if it missed a run due to machine being off +Persistent=true +# Run 15 minutes after boot for the first time +OnBootSec=900 +# Run every 24 hours thereafter +OnUnitInactiveSec=86400 +# File describing job to execute +Unit=backup.sh.service + +[Install] +WantedBy=timers.target