From 1c9e5a31e1c7c3a62b4f0cd8630c14a5a6ef5178 Mon Sep 17 00:00:00 2001 From: James Nairn <jwrn3@cam.ac.uk> Date: Tue, 1 Dec 2020 12:17:45 +0000 Subject: [PATCH] Export Support Added systemd files to support weekly_export.sh Added usage_notes.txt to list troubleshooting commands --- canto_weekly_export.service | 11 +++++++++++ canto_weekly_export.timer | 8 ++++++++ usage_notes.txt | 11 +++++++++++ 3 files changed, 30 insertions(+) create mode 100644 canto_weekly_export.service create mode 100644 canto_weekly_export.timer create mode 100644 usage_notes.txt diff --git a/canto_weekly_export.service b/canto_weekly_export.service new file mode 100644 index 0000000..89cca46 --- /dev/null +++ b/canto_weekly_export.service @@ -0,0 +1,11 @@ +[Unit] +Description=Runs Canto weekly_export.sh script +After=network-online.target +Wants=network-online.target + +[Service] +WorkingDirectory=/data/export/canto-space/canto +ExecStart=/data/export/canto-space/weekly_export.sh + +[Install] +WantedBy=default.target \ No newline at end of file diff --git a/canto_weekly_export.timer b/canto_weekly_export.timer new file mode 100644 index 0000000..0d50ab7 --- /dev/null +++ b/canto_weekly_export.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Run canto_weekly.service on Weds at 12pm. + +[Timer] +OnCalendar=Weds 12:00:00 + +[Install] +WantedBy=timers.target \ No newline at end of file diff --git a/usage_notes.txt b/usage_notes.txt new file mode 100644 index 0000000..91ca3f7 --- /dev/null +++ b/usage_notes.txt @@ -0,0 +1,11 @@ +List all timers +# systemctl list-timers --all + +Should see output like +# root@flybase-vm:/data/export/canto-space/logs# systemctl list-timers --all +NEXT LEFT LAST PASSED UNIT ACTIVATES +Mon 2020-12-07 01:00:00 GMT 5 days left Mon 2020-11-30 01:00:35 GMT 1 day 10h ago canto_weekly.timer canto_weekly.service + +Basic consistency check of script (no output is good) +# bash -n weekly_routine.sh + -- GitLab