Skip to content

Instantly share code, notes, and snippets.

@zany130
Last active April 7, 2024 02:09
Show Gist options
  • Save zany130/9527b04b21ebe8555f11111629da84e1 to your computer and use it in GitHub Desktop.
Save zany130/9527b04b21ebe8555f11111629da84e1 to your computer and use it in GitHub Desktop.
backup dot files with rdiff-backup
- **backup**
- **Cache**
- **cache**
- **compatdata
- **temp**
- **Temp**
- **.steam**
- /home/zany130/.android/
- /home/zany130/.audacity-data/
- /home/zany130/.cargo/
- /home/zany130/.cmake/
- /home/zany130/.clamtk/
- /home/zany130/.clojure/
- /home/zany130/.codestream/
- /home/zany130/.config/Mailspring/
- /home/zany130/.config/Microsoft/Microsoft Teams/Service Worker/
- /home/zany130/.config/heroic/tools/
- /home/zany130/.config/plasmaConfSaver/
- /home/zany130/.config/steamtinkerlaunch/backup/
- /home/zany130/.config/steamtinkerlaunch/downloads/
- /home/zany130/.config/steamtinkerlaunch/logs/
- /home/zany130/.config/steamtinkerlaunch/mo2/
- /home/zany130/.config/steamtinkerlaunch/proton/
- /home/zany130/.config/steamtinkerlaunch/vortex/
- /home/zany130/.config/steamtinkerlaunch/wine/
- /home/zany130/.dart*
- /home/zany130/.ddd/
- /home/zany130/.devkit*
- /home/zany130/.dotnet/
- /home/zany130/.dvdcss/
- /home/zany130/.dropbox*
- /home/zany130/.electron-gyp/
- /home/zany130/.esmtp_queue/
- /home/zany130/.git/
- /home/zany130/.gnome/
- /home/zany130/.gnupg/
- /home/zany130/.gradle/
- /home/zany130/.googleearth/
- /home/zany130/.itch/
- /home/zany130/.java/
- /home/zany130/.jd/
- /home/zany130/.kite/
- /home/zany130/.local/share/anime-game-launcher/
- /home/zany130/.local/share/ark/
- /home/zany130/.local/share/baloo/
- /home/zany130/.local/share/bottles/runners/
- /home/zany130/.local/share/bottles/temp*
- /home/zany130/.local/share/chezmoi/
- /home/zany130/.local/share/CMakeTools/
- /home/zany130/.local/share/cemu/graphicPacks/
- /home/zany130/.local/share/com.github.tkashkin.gamehub/
- /home/zany130/.local/share/desktop-directories/
- /home/zany130/.local/share/discover/kuserfeedback/
- /home/zany130/.local/share/DisplayCAL/
- /home/zany130/.local/share/dolphin/kuserfeedback/
- /home/zany130/.local/share/feral-interactive/
- /home/zany130/.local/share/flatpak/
- /home/zany130/.local/share/gnome-boxes/
- /home/zany130/.local/share/com.vasilvestre.totkMM/
- /home/zany130/.local/share/JetBrains
- /home/zany130/.local/share/lutris/
- /home/zany130/.local/share/NuGet/
- /home/zany130/.local/share/torbrowser/
- /home/zany130/.local/share/Steam/
- /home/zany130/.local/share/suyu/nand/
- /home/zany130/.local/share/UnityHub/
- /home/zany130/.local/share/unity3d/
- /home/zany130/.local/share/waydroid/
- /home/zany130/.local/share/Trash/
- /home/zany130/.local/share/yuzu/nand/
- /home/zany130/.local/share/Zeal/
- /home/zany130/.m2/
- /home/zany130/.mcfly
- /home/zany130/.mono/
- /home/zany130/.mozilla/
- /home/zany130/.node*
- /home/zany130/.nv/
- /home/zany130/.npm/
- /home/zany130/.nuget/
- /home/zany130/.phoronix-test-suite/
- /home/zany130/.pki/
- /home/zany130/.pcloud/
- /home/zany130/.stack/
- /home/zany130/.stremio-server/
- /home/zany130/.shiv/
- /home/zany130/.var/app/com.usebottles.bottles/data/
- /home/zany130/.vcpkg/
- /home/zany130/.vpython*
- /home/zany130/.vscode-oss/
- /home/zany130/.webcatalog/
- /home/zany130/.webos/
- /home/zany130/.wine/
- /home/zany130/.yarn/
- /home/zany130/.zoom/
+ /home/zany130/.*
- /home/zany130/*
[Unit]
Description=Clean up rdiff-bak snapshots
[Service]
Type=oneshot
ExecStart=rdiff-backup --verbosity 5 remove increments --older-than 30D /mnt/GAMES/RdiffBak/
[Unit]
Description=Clean up rdiff-bak snapshots after every backup
Wants=rdiff-bak.timer
Wants=rdiff-bak-tar.timer
[Timer]
OnUnitInactive=rdiff-bak.timer
OnUnitInactive=rdiff-bak-tar.timer
OnCalendar=monthly
Persistent=true
[Install]
WantedBy=timers.target
[Unit]
Description=Backup rdiffbak files into a tar in pCloud
[Service]
Type=oneshot
ExecStart=/home/zany130/Scripts/tarRdiff-Bak.sh
[Unit]
Description=Schedule Backup rdiffbak files into a tar in pCloud
Wants=rdiff-bak.timer
Wants=rdiff-bak-clean.timer
[Timer]
OnUnitInactive=rdiff-bak.timer
OnUnitInactive=rdiff-bak-clean.timer
OnCalendar=Daily
Persistent=true
[Install]
WantedBy=timers.target
[Unit]
Description=Backup dot files with rdiff-bak
[Service]
Type=oneshot
ExecStart=rdiff-backup --verbosity 5 backup --print-statistics --include-special-files --include-globbing-filelist /home/zany130/.config/include-list.txt /home/zany130 /mnt/GAMES/RdiffBak/
[Unit]
Description=Schedule Backup dot files with rdiff-bak
Wants=rdiff-bak-clean.timer
Wants=rdiff-bak-tar.timer
[Timer]
OnUnitInactive=rdiff-bak-clean.timer
OnUnitInactive=rdiff-bak-tar.timer
OnCalendar=*-*-* 0/2:00:00
Persistent=true
[Install]
WantedBy=timers.target
#!/bin/bash
# Backup source
backsource=/mnt/GAMES/RdiffBak
# Backup destination
backdest=/home/zany130/pCloudDrive/RdiffBak/
# Labels for backup name
pc=${HOSTNAME}
date=$(date "+%F")
backupfile="$backdest/rdiff-bak-$pc-$date.tar.gz"
bsdtar --acls --xattrs -cpvaf "$backupfile" "$backsource"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment