How To Backup Your Entire Linux System Using Rsync - OSTechNix

Hi, its my first post on this board, hope I followed rules from rtfm, If not - very sorry.

To backup the entire system, all you have to do is open your Terminal and run the following command as root user:

$ sudo rsync -aAXv / --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} /mnt
–exclude – Excludes the given directories from backup.

How to apply additinoal filters to exclude?

  1. File size is bigger than 50mb
  2. File type: *.mp3, .*mp4, *.bak, etc…
  3. Dir name contain: backup, bckp, downloads, cloud, gdrive, etc…

*Create dummy files and dirs in backup, named as excluded files.

Thanks for your articles and nix evangelism.


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki