加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

使用bash和rsync备份

发布时间:2020-12-15 18:35:43 所属栏目:安全 来源:网络整理
导读:有没有办法在接收器上自动重命名现有文件?例如:如果filename已经存在,它会自动将文件名重命名为filename_001,filename_002等等…. 到目前为止我只有这个: $rsync -rh --progress --stats --exclude '.thumb' --update --perms /origin /destination 顺
有没有办法在接收器上自动重命名现有文件?例如:如果filename已经存在,它会自动将文件名重命名为filename_001,filename_002等等….

到目前为止我只有这个:

$rsync -rh --progress --stats --exclude '.thumb' 
    --update --perms /origin /destination

顺便说一句,我知道rsync有–ignore-existing“跳过更新接收器上存在的文件”,但我想我需要的东西就像–rename-existing.

如果您希望保留数据集的增量版本(不使用版本控制 such as the git suggestion,这将是另一种替代方法),请考虑使用 rsnap而不是rsync.

它允许您拍摄文件夹或文件集的快照,以便您可以恢复在任何给定时间点的整个事物.它不应该保存整个文件的多个副本,而应该只保存它们之间的差异,从而节省了所有这些重复项的空间.

由于它使用rsync来复制幕后文件,因此可以将rsync选项附加到命令的末尾.例如,在您保留十个备份副本的情况下,您可以执行以下操作:

$rsnap 10 /origin /destination -- --progress --stats 
    --exclude '.thumb' --update --perms

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读