add systemd timer to run daily backups
This commit is contained in:
parent
0580a2edf2
commit
e9e27f1f34
14
sbin/bashup-cron.sh
Executable file
14
sbin/bashup-cron.sh
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Bashup - A set of bash scripts for managing backups.
|
||||||
|
# https://git.stack-source.com/msb/bashup
|
||||||
|
# MIT License Copyright (c) 2022 Matthew Saunders Brown
|
||||||
|
|
||||||
|
# load include file
|
||||||
|
source /usr/local/sbin/bashup.sh
|
||||||
|
|
||||||
|
for job in "${bashup_jobs[@]}"; do
|
||||||
|
if [[ -x /usr/local/sbin/bashup-backup-$job.sh ]]; then
|
||||||
|
/usr/local/sbin/bashup-backup-$job.sh
|
||||||
|
fi
|
||||||
|
done
|
10
systemd/bashup-cron.service
Normal file
10
systemd/bashup-cron.service
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# Bashup - A set of bash scripts for managing backups.
|
||||||
|
# https://git.stack-source.com/msb/bashup
|
||||||
|
# MIT License Copyright (c) 2022 Matthew Saunders Brown
|
||||||
|
#
|
||||||
|
[Unit]
|
||||||
|
Description=Bashup cron for automatic backups
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/local/sbin/bashup-cron.sh
|
15
systemd/bashup-cron.timer
Normal file
15
systemd/bashup-cron.timer
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# Bashup - A set of bash scripts for managing backups.
|
||||||
|
# https://git.stack-source.com/msb/bashup
|
||||||
|
# MIT License Copyright (c) 2022 Matthew Saunders Brown
|
||||||
|
#
|
||||||
|
[Unit]
|
||||||
|
Description=Bashup cron for automatic backups
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
# Run daily between 3-5 am
|
||||||
|
OnCalendar=*-*-* 03:00:00
|
||||||
|
RandomizedDelaySec=7200
|
||||||
|
Unit=bashup-cron.service
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
Loading…
Reference in New Issue
Block a user