使用 rsync 进行备份时,您会过滤/排除哪些列表?

使用 rsync 进行备份时,您会过滤/排除哪些列表?

我正在尝试构建一个全面的过滤器/排除文件,以防止备份没有意义的内容,例如临时/缓存数据或易于重新创建的文件。如果您可以分享(部分)rsync 备份的排除列表,我将不胜感激。

这是我到目前为止所拥有的:

## Universal excludes

lost+found
ld.so.cache

# backup text files (e.g. from Emacs)
- *~
- \#*\#

# Commonly distributed Mac OS X cache
- .DS_Store

# Commonly distributed Windows cache
- Thumbs.db

## Root file system
- /dev/
- /etc/modules.conf
- /media/
- /proc/
- /sys/
- /tmp/
- /usr/portage/
- /usr/src/
- /var/tmp/
- /var/log/

# Of the mounted stuff, whitelist only my two data partitions
- /mnt/
+ /mnt/data1
+ /mnt/data2

# Common package managers (apt, yum)
- /var/cache/apt/
- /var/cache/yum/

## Filters for home dirs (assumes /home/<user> dir structure)

# Cache
- /home/*/.cache/

# Downloads
- /home/*/Downloads/
+ /home/*/Downloads/src/

# Dropbox
- /home/*/Dropbox

# Temporary files / cache
- /home/*/.local/share/Trash
- /home/*/.cache
- /home/*/.Trash

# X Windows System
- /home/*/.xsession-errors*

# Gnome temp stuff
- /home/*/.compiz*/session
- /home/*/.gksu.lock
- /home/*/.gvfs

# Common Applications

# Adobe Reader
- /home/*/.adobe/**/AssetCache/
- /home/*/.adobe/**/Cache/
- /home/*/.adobe/**/Temp/
- /home/*/.adobe/**/UserCache.bin

# Dropbox temp stuff
- /home/*/.dropbox/
- /home/*/.dropbox-dist/

# Gimp
- /.gimp-*/tmp
- /.gimp-*/swap

# Mozilla Firefox
- /home/*/.mozilla/firefox/*/Cache/
- /home/*/.mozilla/firefox/*/lock
- /home/*/.mozilla/firefox/*/.parentlock

# Mozilla Thunderbird
- /home/*/.mozilla-thunderbird/*/lock
- /home/*/.mozilla-thunderbird/*/.parentlock

# Pidgin (accounts.xml contains passwords in clear text)
- /home/*/.purple/accounts.xml

您认为添加到此过滤器文件中还有哪些有用的内容,或者您​​使用什么以及为什么?

答案1

我通常也会排除:

  • /etc/mtab
  • /run/
  • /var/run/
  • /var/cache/pacman/pkg/(在 Arch Linux 系统上)

相关内容