From 15da53d5400130e5d3d310a3173f1e3ac855f6e9 Mon Sep 17 00:00:00 2001 From: BrainwreckedTech <3752022+BrainwreckedTech@users.noreply.github.com> Date: Sat, 14 Sep 2019 09:20:11 -0400 Subject: [PATCH] Modified backup-files to not rely on a script. --- backup-files-rsync.service | 12 ++++++++++++ backup-files-rsync.timer | 10 ++++++++++ 2 files changed, 22 insertions(+) create mode 100644 backup-files-rsync.service create mode 100644 backup-files-rsync.timer 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