Add systemd service and timer for client
This commit is contained in:
parent
785c0245f0
commit
c502982cac
|
@ -0,0 +1,6 @@
|
|||
[Unit]
|
||||
Description=Start backup via rs-backup-suite
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/rs-backup-run
|
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description=Run rs-backup-run every day
|
||||
|
||||
[Timer]
|
||||
OnCalendar=daily
|
||||
Persistent=true
|
||||
Unit=rs-backup-run.service
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -207,6 +207,11 @@ if [[ $MODE == "install" ]]; then
|
|||
$CP ./client/usr/bin/* /usr/bin/
|
||||
$CP ./server/usr/bin/rs-version /usr/bin/
|
||||
|
||||
if [ -d /etc/systemd/system ]; then
|
||||
echo 'Detected systemd. Run `systemctl enable rs-backup-run.timer` to enable daily backups.'
|
||||
$CP ./client/etc/systemd/system/* /etc/systemd/system
|
||||
fi
|
||||
|
||||
# Do not overwrite existing config
|
||||
if [ ! -e /etc/rs-backup/client-config ]; then
|
||||
$CP ./client/etc/rs-backup /etc/
|
||||
|
|
Loading…
Reference in New Issue