diff --git a/backup-files-rsync.service b/backup-files-rsync.service new file mode 100644 index 0000000..63f04fd --- /dev/null +++ b/backup-files-rsync.service @@ -0,0 +1,12 @@ +[Unit] +Description=Backup Files + +[Service] +Environment=SOURCE=/path/to/source +Environment=DESTINATION=user@host:/path/to/destination +Environment=EXCLUDES="--exclude path1 --exclude path2" +Type=simple +Nice=19 +IOSchedulingClass=2 +IOSchedulingPriority=7 +ExecStart=/bin/sh -c '/usr/bin/rsync -HAax ${EXCLUDES} "${SOURCE}/" "${DESTINATION}/"' diff --git a/backup-files-rsync.timer b/backup-files-rsync.timer new file mode 100644 index 0000000..903b331 --- /dev/null +++ b/backup-files-rsync.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Backup Files + +[Timer] +OnCalendar=04:15:00 +AccuracySec=300s +Persistent=true + +[Install] +WantedBy=timers.target