我偶尔会在 rsnapshot 日志中收到此消息,并在 中收到相同的消息。不幸的是,除了最后的摘要警告外,除了中,/var/log/messages
没有其他与正常输出不同的内容:loglevel 5
/etc/rsnapshot.conf
[24/Feb/2014:11:00:02] /usr/bin/rsnapshot daily: started
[24/Feb/2014:11:00:02] Setting locale to POSIX "C"
[24/Feb/2014:11:00:02] echo 9045 > /.../temp/rsnapshot.pid
[24/Feb/2014:11:00:02] /bin/rm -rf /mnt/backup/.snapshots/daily.5/
[24/Feb/2014:11:00:48] mv /mnt/backup/.snapshots/daily.4/ /mnt/backup/.snapshots/daily.5/
[24/Feb/2014:11:00:48] mv /mnt/backup/.snapshots/daily.3/ /mnt/backup/.snapshots/daily.4/
[24/Feb/2014:11:00:48] mv /mnt/backup/.snapshots/daily.2/ /mnt/backup/.snapshots/daily.3/
[24/Feb/2014:11:00:48] mv /mnt/backup/.snapshots/daily.1/ /mnt/backup/.snapshots/daily.2/
[24/Feb/2014:11:00:48] mv /mnt/backup/.snapshots/daily.0/ /mnt/backup/.snapshots/daily.1/
[24/Feb/2014:11:00:48] mkdir -m 0755 -p /mnt/backup/.snapshots/daily.0/
[24/Feb/2014:11:00:48] /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/home/srv/recycle/*} --exclude=mnt/backup/.snapshots --link-dest=/mnt/backup/.snapshots/daily.1/.../ /. /mnt/backup/.snapshots/daily.0/.../
[24/Feb/2014:11:02:13] Some files and/or directories in / vanished during rsync operation
[24/Feb/2014:11:02:13] touch /mnt/backup/.snapshots/daily.0/
[24/Feb/2014:11:02:13] No directory to delete: /mnt/backup/.snapshots/_delete.9045
[24/Feb/2014:11:02:13] rm -f /home/kev/scheduled/temp/rsnapshot.pid
[24/Feb/2014:11:02:13] WARNING: /usr/bin/rsnapshot daily: completed, but with some warnings
这可能是什么?为什么即使我将其设置为最高日志级别,它也不会报告哪些文件消失了?(或者我甚至没有正确设置日志级别?因为这看起来不太详细。)
答案1
rsync 的最新源发行版包含一个名为 rsync-no-vanished 的包装脚本:
#!/bin/bash
IGNOREEXIT=24
IGNOREOUT='^(file has vanished: |rsync warning: some files vanished before they could be transferred)'
set -o pipefail
rsync "${@}" 2>&1 | (egrep -v "$IGNOREOUT" || true)
ret=$?
if [[ $ret == $IGNOREEXIT ]]
then
ret=0
fi
exit $ret
答案2
rsync 操作期间,/ 中的某些文件和/或目录消失了
意思就是这样。RSync 使用“快速检查”算法(默认情况下)创建自上次运行以来已更改的所有文件的列表,该算法查找大小或上次修改时间已更改的文件(rsync(1))。此警告报告,当 rsync 尝试将文件列表中的文件或目录复制到目标时,它们不再存在。
已更改的文件很可能是临时文件,但如果您想验证这一点,您可以配置 rsnapshot 以向 rysnc 传递--list-only
构建文件列表的选项,等待适当的时间,再次运行它并比较两者以查看哪些文件已“消失”。