Add systemd service and timer for client

This commit is contained in:
Janek Bevendorff 2015-10-16 13:22:04 +02:00
parent 785c0245f0
commit c502982cac
3 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,6 @@
[Unit]
Description=Start backup via rs-backup-suite
[Service]
Type=simple
ExecStart=/usr/bin/rs-backup-run

View File

@ -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

View File

@ -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/