我有backup2l设置rsync我的备份。 虽然我发现如果在备份发生时文件正在使用,它会产生一个错误。
这是我收到的电子邮件:
/etc/cron.daily/zz-backup2l: backup2l v1.5 by Gundolf Kiefer Sun Sep 25 03:20:50 BST 2011 Running pre-backup procedure... writing dpkg selections to /root/.dpkg-selections.log... dumping databases Removing old backups... Preparing differential level-2 backup <all.104> based on <all.103>... 145008 / 145008 file(s), 12432 / 12432 dir(s), 10.3GB / 10.3GB (uncompressed) skipping: 175 file(s), 0 dir(s), 735KB (uncompressed) Creating archive using 'DRIVER_TAR_BZ2'... tar: Removing leading `/' from hard link targets tar: /var/vmail/vmail01/example.com/b/ba/bar/barry-2010.12.11.10.28.01/Maildir/dovecot.index.log.2: Cannot stat: No such file or directory tar: Exiting with failure status due to previous errors Checking TOC of archive file (< real file, > archive entry)... 47299d47298 < /var/vmail/vmail01/example.com/b/ba/bar/barry-2010.12.11.10.28.01/Maildir/dovecot.index.log.2 96928c96927 Creating check file for <all.104>... Running post-backup procedure... Sun Sep 25 09:26:49 BST 2011 Summary ======= Backup Date Time | Size | Skipped Files+D | New Obs. | Err. ------------------------------------------------------------------------------ all.1 2011-09-21 02:26 | 7.3G | 198 161103 |161103 0 | 5 all.101 2011-09-22 02:25 | 51.4M | 192 161788 | 2270 1585 | 0 all.102 2011-09-23 02:25 | 46.6M | 213 162460 | 1610 938 | 0 all.103 2011-09-24 02:25 | 58.6M | 188 156809 | 2450 8101 | 0 all.104 2011-09-25 03:23 | 7.4G | 175 157440 |157440 156809 | 2 Filesystem Size Used Avail Use% Mounted on /dev/vda 40G 30G 8.4G 78% /
Backup2lconfiguration
################################################## # Configuration file for backup2l # ################################################## # Define the backup2l version for which the configuration file is written. # This way, future versions can automatically warn if the syntax has changed. FOR_VERSION=1.4 ################################################## # Volume identification # This is the prefix for all output files; # multiple volumes can be handled by using different configuration files VOLNAME="all" ################################################## # Source files # List of directories to make backups of. # All paths MUST be absolute and start with a '/'! # SRCLIST=(/etc /root /home /var/mail /usr/local) SRCLIST=(/etc /root /home /var/vmail /var/www /var/svn /usr/local /var/backups/mysql /var/backups/ldap) # The following expression specifies the files not to be archived. # See the find(1) man page for further info. It is discouraged to # use anything different from conditions (eg actions) as it may have # unforeseeable side effects. # This example skips all files and directories with a path name containing # '.nobackup' and all .o files: #SKIPCOND=(-path "*.nobackup*" -o -name "*.o") SKIPCOND=(-path "*.nobackup*" -o -name "*.o" -name "*~" -o -name "cache.*" -o -path "*/tmp/captchas/*") # If you want to exclude several directories use the following expression: # SKIPCOND=(-path '/path1' -o -path '/path1/*' -o -path '/path2' -o -path '/path2/*') # NOTE: If you do not have anything to skip, use: # SKIPCOND=(-false) # "SKIPCOND=()" does not work ################################################## # Destination # Mount point of backup device (optional) #BACKUP_DEV="/disk2" # Destination directory for backups; # it must exist and must not be the top-level of BACKUP_DEV BACKUP_DIR="/var/backups/localhost" ################################################## # Backup parameters # Number of levels of differential backups (1..9) MAX_LEVEL=2 # Maximum number of differential backups per level (1..9) MAX_PER_LEVEL=7 # Maximum number of full backups (1..8) #MAX_FULL=2 MAX_FULL=1 # For differential backups: number of generations to keep per level; # old backups are removed such that at least GENERATIONS * MAX_PER_LEVEL # recent versions are still available for the respective level GENERATIONS=1 # If the following variable is 1, a check file is automatically generated CREATE_CHECK_FILE=1
是的,这个错误信息是(a)意图和(b)我也经常发生。
这个错误只是由于backup2l的运行方式造成的:制作一个备份文件列表,备份它们,然后检查备份中的文件。 由于备份过程需要一些时间,您经常会在过程中获得/某些/文件,并因此导致备份错误。 你一定要/知道/关于这些文件,因为备份失败往往是严重的业务[1]。
所以,我的build议是在一天中不太忙的时候备份。 你会从你的备份cronjob收到一封邮件,你应该仔细阅读它。 有时你会遇到这些错误,但对于备份来说并不致命。 只要确保它不是每天都是同一个文件。
[1]这里有一个小小的轶事:一段时间以来,我们认为通过将主要数据分区作为大学存储上的环回安装文件来回避是一个好主意。 刚刚导致数据分区文件(〜1 TB)每天晚上都发送到备份服务器,这需要几个小时,然后检查更改,并且更改已被丢弃。 没有备份实际上在几个月内执行。 重要的一刻,从那天起,我们确保与所有相关人员进行交谈,确保备份/实际/制造和可恢复。