您可以轻松地将主文件夹备份到外部硬盘驱动器上
rsync -a --exclude=.cache --progress /home/$USER /media/linuxbackup/home/$USER
我排除了.cache文件夹,因为我认为从该备份重新安装时不再需要它。
我在这里找到了可以在常规备份中排除的所有文件夹的列表:
可以从主目录备份中排除哪些文件和目录?
我创建了此答案的列表,其中包含以下形式的注释:
#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
如何将此列表添加到我的rsync命令中?
.Trash
,还经常出现.Trash-1000
(至少在当前的Ubuntu-MATE 14下),所以更好地满足.Trash-*
呢?