rsnapshot 备份分区磁盘空间

rsnapshot 备份分区磁盘空间

我一直在读常见问题解答男人页面rsnapshot,我正在努力找出如果备份分区已满它会做什么。

即如果我将备份设置为每小时运行一次,备份到专用的备份分区。当此分区的使用率达到 100% 时会发生什么。

它会自动轮换/删除旧备份吗?还是直接退出并崩溃?


我正在寻找“简单”的备份解决方案,如果备份分区已满,该解决方案具有某种生存能力。

答案1

使用默认配置(保存以将备份位置更改为/smallbup)和 rsnapshot 1.3.1

svr-backup-01 ~ # lvcreate --name smallbup --size 32M RAID
  Logical volume "smallbup" created
svr-backup-01 ~ # mkfs.ext4 -q -m 0 /dev/RAID/smallbup 
svr-backup-01 ~ # mkdir /smallbup
svr-backup-01 ~ # mount /dev/RAID/smallbup /smallbup/
svr-backup-01 ~ # rsnapshot hourly
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: write failed on "/smallbup/hourly.0/localhost/home/fukawi2/LSK-Database-1GB.dd": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(322) [receiver=3.0.9]
rsync: connection unexpectedly closed (1107 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9]
----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot hourly 
----------------------------------------------------------------------------
ERROR: /usr/bin/rsync returned 12 while processing /home/
rsync: writefd_unbuffered failed to write 4092 bytes to socket [sender]: Broken pipe     (32)
rsync: write failed on "/smallbup/hourly.0/localhost/usr/local/man/man5/husk.conf.5p": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(322) [receiver=3.0.9]
rsync: connection unexpectedly closed (178 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9]
ERROR: /usr/bin/rsync returned 12 while processing /usr/local/

所以总而言之,rsync 将返回错误(12)。rsnapshot 不会处理该错误并中止,留下完整的文件系统:

svr-backup-01 ~ # df -h /smallbup/
Filesystem                 Size  Used Avail Use% Mounted on
/dev/mapper/RAID-smallbup   31M   31M   13K 100% /smallbup

相关内容