Skip to content

Instantly share code, notes, and snippets.

@kayodelycaon

kayodelycaon/backup.service Secret

Last active Jan 16, 2021
Embed
What would you like to do?
reMarkable Backup Script. All files expect to be in /home/root/backup/
[Unit]
Description=Rsync documents to basement server.
Wants=backup.timer
[Service]
Type=oneshot
ExecStart=/home/root/backup/backup.sh
[Install]
WantedBy=multi-user.target
#!/bin/bash
SSID=`iwgetid -r`
if [ "$SSID" = "Aardvark 51" ]; then
/opt/bin/rsync --quiet --recursive --times --rsh=ssh --delete --partial "/home/root/.local/share/remarkable/xochitl" "ac@10.0.1.23:Dropbox/Projects/reMarkable/document_backups/"
fi
[Unit]
Descriptions=Backs up files every hour.
Requires=backup.service
[Timer]
Unit=backup.service
# Wait for network to be available.
ExecStartPre=/bin/sleep 30
OnBootSec=5min
OnUnitActiveSec=30min
[Install]
WantedBy=timers.target
#!/bin/bash
opkg install rsync
chmod +x /home/root/backup/backup.sh
ln -s /home/root/backup/backup.service /etc/systemd/system/backup.service
ln -s /home/root/backup/backup.timer /etc/systemd/system/backup.timer
systemctl enable backup.timer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment