Last active
December 13, 2021 05:57
-
-
Save StephenWetzel/19ed310091df4d433e972f4a1b0447ae to your computer and use it in GitHub Desktop.
Backup Pi to NFS drive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Add to /etc/fstab: | |
# 192.168.1.123:/mnt/media /mnt/nfs/server/media nfs defaults,rw,user 0 0 | |
# Cron: | |
# 03 * * * * /home/pi/bin/backup_full_pi.sh | |
date | |
backup_dir="/mnt/nfs/server/media/Backup/Pi/$(hostname)/" | |
rsync -turq --no-perms --chmod=777 --mkpath /home $backup_dir | |
rsync -turq --no-perms --chmod=777 --mkpath /etc $backup_dir | |
rsync -turq --no-perms --chmod=777 --mkpath /var/lib $backup_dir | |
rsync -turq --no-perms --chmod=777 --mkpath /boot $backup_dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment