BACKUP LINUX SYSTEM TO AN EXTERNAL DRIVE/NAS

This is a script to backup your root drive to a destination disk. You will need rsync to use this script.

#!/bin/bash
BACKUPPATH=/backup/fullsystembackup-"$(/bin/date +\%y-\%m-\%d)"

#Start backup
sudo rsync -aAXvP --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/home/*/media*","/home/*/Dropbox*","/home/*/.local/share/Trash/*","/home/*/.thumbnails/*","/home/*/.cache/mozilla/*","/home/*/.cache/chromium/*","/home/*/.gvfs","/var/log/journal/*","/lost+found"} / $BACKUPPATH

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.