使用rsync和--link-DEST磁盘使用率问题 [英] disk usage issue with rsync and --link-dest

查看:513
本文介绍了使用rsync和--link-DEST磁盘使用率问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有rsync的和--link-DEST磁盘使用问题
增量备份充分的磁盘空间...

I have disk usage problem with rsync and --link-dest Incremental backup is taking full disk space...

显示顺序....

@localhost media]$ ls
orig
----------------------------------------------------
localhost media]$ du -sh .
25M .
----------------------------------------------------
localhost media]$ rsync -avh orig/ full
----------------------------------------------------
@localhost media]$ du -sh .
49M .
----------------------------------------------------
localhost media]$ echo 1111 > orig/foo111
----------------------------------------------------
localhost media]$ rsync -avh --link-dest=full orig/ orig_1
----------------------------------------------------
localhost media]$ ls orig_1/foo111 
orig_1/foo111
_____________________________________________________

localhost media]$ ls full/foo111
ls: cannot access full/foo111: No such file or directory

一切看起来不错,到目前为止,我得到了我想要的东西,最新的变化体现在orig_1
但是这些目录并不难挂,他们都是全尺寸。

EVERYTHING LOOKS good so far, I got what I want, the latest change is reflected in orig_1 But the the directories are not hard linked and they are all full size.

-----------------------------------------------------
localhost media]$ du -sh .
74M .
---------------------------------------------
localhost media]$ du -sh orig_1/
25M orig_1/
--------------------------------------------
localhost media]$ du -sh orig
25M orig
---------------------------------------------
localhost media]$ du -sh full
25M full

是我想有orig_1大小0 ?????和stat命令显示没有硬链接:(
请让我知道如果我做错什么?

Am I suppose to have the orig_1 size as 0 ????? and stat command shows no hard links :( Please let me know if I am doing anything wrong ?

推荐答案

当你运行 rsync的-avh --link-DEST =全原稿/ orig_1 ,你忽略了这错误信息(如果你删除它更明显 -v

When you ran rsync -avh --link-dest=full orig/ orig_1, you ignored this error message (it's more obvious if you remove -v):

--link-dest arg does not exist: full

如果我们再看看男人的rsync - 链接DEST ,我们发现:

If we then take a look at man rsync under --link-dest, we find:

If DIR is a relative path, it is relative to the destination directory. 

它就在那里。 完全是相对于当前目录。相对于目标目录,这将是 ../全

And there it is. full is relative to the current directory. Relative to the destination directory, it would be ../full.

如果你再试 rsync的-avh --link-DEST = .. /全原稿/ orig_1 ,你得到你所期望的:

If you try again with rsync -avh --link-dest=../full orig/ orig_1, you get what you expect:

$ du -sh *
149M    full
149M    orig
232K    orig_1
$ du -sh .
298M    .

需要注意的是,单独计数时,目录仍然会出现占用整个航天:

Note that, when counted individually, the directories still appear take up the full space:

$ du -sh orig_1 
149M    orig_1

这是因为保持它已经看到文件的曲目,可避免重复计数它们。

This is because du keeps track of files it's already seen, and avoids counting them twice.

这篇关于使用rsync和--link-DEST磁盘使用率问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆