You can easyly backup your home folder on an external harddrive with
rsync -a --exclude=.cache --progress /home/$USER /media/linuxbackup/home/$USER
I excluded the .cache folder cause I think I will never need it when I have to re-install from this backup.
I found this list of all folders that I could exclude in a normal backup here:
What files and directories can be excluded from a backup of the home directory?
I created a list of this answer that contains some coments in this form:
#These directories may be excluded:
.gvfs # contains mounted file systems?
.local/share/gvfs-metadata
.Private # contains the actual encrypted home directory
.dbus # session-specific
.cache
.Trash # do I need to say more?
.local/share/Trash
.cddb # cached info about audio CDs
.aptitude # cached packages lists
#Flash-specific:
.adobe # Cache for flash, maybe others?
.macromedia # except for Flash persistence, there is no reason to keep this
#Files:
.xsession-errors # contains errors from the current graphical session
.recently-used # recently used files
.recently-used.xbel
.thumbnails
How can I add this list to my rsync command?
The exclude list may only contain filenames, foldernames and lines starting with
#
. A comment behind the foldername is not allowed. I created a Git repository with all known files and folders that are superfluous:Download this ignorelist to /var/tmp/ignorelist
Then start the rsync with
Note:
In the ignorelist there is a commented section at the start with folders, that are probably not worth a backup either. Uncomment those, you don't need.
From
man rsync
:Could try this if directories and files within are all you want backing-up. Excludes all hidden directories.
rsync -aP --exclude=.* /home/$USER/ /media/$USER/folder
Node modules are not mentioned, you can easily remove unwanted node module folders with the following
then
Be careful to only section folders of your work