Ubuntu – Tutorial on how to back up the full Ubuntu desktop and files?

backup

I would like to be able to back up all my settings and files to a dedicated external hard drive in a way that makes (1) all the backup files accessible and (2) would allow me to restore my system is there is a crash.

Is there an app for this or any pointers?

Thank so much.

Best Answer

There are plenty of tools to help you backup your system. My personal favorit is rsync

To back up your home folder

rsync -a --delete --quiet /home/User /path/to/HDD
-a
    indicates that files should be archived, meaning that most of their characteristics are preserved
--delete 
    means files deleted on the source are to be deleted on the backup as well

It can be done using ssh as well just add -e ssh /home/User user@server:path/to/backup

(if the dedicated HDD is running on a separate server such as mine is)

As a full system backup (which I'm failry certain is what you're looking for)

rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /path/to/backup/folder

Using the option -aAXv ensures that all file permissions, ownerships, links, mod times, ACL's and extended attributes are preserved!

I personally have a script to backup my home folder weekly and then zip it and send it to my server, and once a month I will do a full system backup and send it to a different more secure server.

You may also be interested in checking out --parial flag! For completeness though here is the man page https://manpage.me/?q=rsync

Related Question