From 8c96e4985b9a0fbe820e5ce1e475e48194339010 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Fri, 6 Dec 2024 19:06:30 -0500 Subject: Switch to rclone for backing up laptop data --- fish/functions/backup.fish | 11 ----------- systemd/user/backup.service | 8 -------- systemd/user/rclone.service | 8 ++++++++ systemd/user/rclone.timer | 8 ++++++++ 4 files changed, 16 insertions(+), 19 deletions(-) delete mode 100644 fish/functions/backup.fish delete mode 100644 systemd/user/backup.service create mode 100644 systemd/user/rclone.service create mode 100644 systemd/user/rclone.timer diff --git a/fish/functions/backup.fish b/fish/functions/backup.fish deleted file mode 100644 index ec42b1e..0000000 --- a/fish/functions/backup.fish +++ /dev/null @@ -1,11 +0,0 @@ -function backup - if not set -q HOSTNAME - set HOSTNAME (hostnamectl hostname) - end - - cd ~/Documents/Backups/$HOSTNAME - cp ~/.local/share/fish/fish_history . - cp ~/.mozilla/firefox/*.default-release/places.sqlite . - cp ~/.thunderbird/*.default-release/Mail/Feeds/feeds.json . - cd - -end diff --git a/systemd/user/backup.service b/systemd/user/backup.service deleted file mode 100644 index 3a3e5b3..0000000 --- a/systemd/user/backup.service +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Back up important files - -[Service] -ExecStart=fish -c backup - -[Install] -WantedBy=default.target diff --git a/systemd/user/rclone.service b/systemd/user/rclone.service new file mode 100644 index 0000000..7e5adc5 --- /dev/null +++ b/systemd/user/rclone.service @@ -0,0 +1,8 @@ +[Unit] +Description=rclone + +[Service] +ExecStart=rclone sync ~ crypt: --transfers 32 --include "Documents/**" --include "Music/**" --include "Pictures/**" --include "Videos/**" --include ".local/share/fish/fish_history" --include ".mozilla/firefox/*.default-release/places.sqlite" --include ".ssh/**" + +[Install] +WantedBy=default.target diff --git a/systemd/user/rclone.timer b/systemd/user/rclone.timer new file mode 100644 index 0000000..3dd449a --- /dev/null +++ b/systemd/user/rclone.timer @@ -0,0 +1,8 @@ +[Unit] +Description=rclone daily timer + +[Timer] +OnCalendar=00:00 UTC + +[Install] +WantedBy=timers.target -- cgit v1.2.3-70-g09d2