rsync同步后目录大小不同
2009-04-09 12:02
190 查看
昨天看见rsync同步后用du -sh 显示的目录大小不同,感觉很困惑,以为同步出错,结果反复查也无果,今天来公司,上QQ群里问,最后确定是磁盘的block size 大小问题,经过 tune2fs -l /dev/sda1 命令查看,发现果然block size 一个是4096 一个是1024,故而确定 du 是文件所占用的磁盘空间大小,不是文件的实际大小;
block size 不一样,或者所占用的 blocks 数量不一样都会导致这种差异
[root@server02 down]# du --help
用法:du [选项]... [文件]...
总结每个<文件>的磁盘用量,目录则取总用量。
长选项必须用的参数在使用短选项时也是必须的。
-a, --all write counts for all files, not just directories
--apparent-size print apparent sizes, rather than disk usage; although
the apparent size is usually smaller, it may be
larger due to holes in (`sparse') files, internal
fragmentation, indirect blocks, and the like
-B, --block-size=SIZE use SIZE-byte blocks
-b, --bytes equivalent to `--apparent-size --block-size=1'
-c, --total produce a grand total
-D, --dereference-args dereference FILEs that are symbolic links
-H like --si, but also evokes a warning; will soon
change to be equivalent to --dereference-args (-D)
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)
--si like -h, but use powers of 1000 not 1024
-k like --block-size=1K
-l, --count-links count sizes many times if hard linked
-L, --dereference dereference all symbolic links
-P, --no-dereference don't follow any symbolic links (this is the default)
-0, --null end each output line with 0 byte rather than newline
-S, --separate-dirs do not include size of subdirectories
-s, --summarize display only a total for each argument
-x, --one-file-system skip directories on different filesystems
-X FILE, --exclude-from=FILE Exclude files that match any pattern in FILE.
--exclude=PATTERN Exclude files that match PATTERN.
--max-depth=N print the total for a directory (or file, with --all)
only if it is N or fewer levels below the command
line argument; --max-depth=0 is the same as
--summarize
--help 显示此帮助信息并离开
--version 显示版本信息并离开
SIZE may be (or may be an integer optionally followed by) one of following:
kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.
block size 不一样,或者所占用的 blocks 数量不一样都会导致这种差异
[root@server02 down]# du --help
用法:du [选项]... [文件]...
总结每个<文件>的磁盘用量,目录则取总用量。
长选项必须用的参数在使用短选项时也是必须的。
-a, --all write counts for all files, not just directories
--apparent-size print apparent sizes, rather than disk usage; although
the apparent size is usually smaller, it may be
larger due to holes in (`sparse') files, internal
fragmentation, indirect blocks, and the like
-B, --block-size=SIZE use SIZE-byte blocks
-b, --bytes equivalent to `--apparent-size --block-size=1'
-c, --total produce a grand total
-D, --dereference-args dereference FILEs that are symbolic links
-H like --si, but also evokes a warning; will soon
change to be equivalent to --dereference-args (-D)
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)
--si like -h, but use powers of 1000 not 1024
-k like --block-size=1K
-l, --count-links count sizes many times if hard linked
-L, --dereference dereference all symbolic links
-P, --no-dereference don't follow any symbolic links (this is the default)
-0, --null end each output line with 0 byte rather than newline
-S, --separate-dirs do not include size of subdirectories
-s, --summarize display only a total for each argument
-x, --one-file-system skip directories on different filesystems
-X FILE, --exclude-from=FILE Exclude files that match any pattern in FILE.
--exclude=PATTERN Exclude files that match PATTERN.
--max-depth=N print the total for a directory (or file, with --all)
only if it is N or fewer levels below the command
line argument; --max-depth=0 is the same as
--summarize
--help 显示此帮助信息并离开
--version 显示版本信息并离开
SIZE may be (or may be an integer optionally followed by) one of following:
kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.
相关文章推荐
- rsync 实现文件同步 (重要数据通过rsyncr把数据同步到不同的两台服务器上,这样可以防止服务器的硬盘故障导致数据丢失) 客户端同步时如果要排某个目录
- Linux rsync目录同步功能实现
- rsync实现目录同步
- rsync + inotify 实现文件目录的实时单向同步
- rsync + inotify-tools 实现web发布目录同步
- Linux使用rsync客户端与服务端同步目录进行备份
- sersync+rsync同步不同主机之间数据
- inotify+rsync多目录同步
- Linux使用rsync客户端与服务端同步目录进行备份
- 使用rsync+inotify的方式监控一个目录,当被监控目录下的子目录被移走后无法同步的问题
- rsync用于同步目录
- 使用rsync进行CentOS服务器之间的目录同步
- [CentOS] rsync同步目录进行备份文件
- rsync + inotify-tools 实现web发布目录同步
- Linux目录同步rsync
- 用 sersync 实现多个不同目录向多个节点实时同步
- rsync同步文件,排除多个文件/目录
- Rsync服务实时同步目录
- Samba 系列(六):使用 Rsync 命令同步两个 Samba4 AD DC 之间的 SysVol 目录
- rsync同步时,删除目标目录比源目录多余文件的方法(--delete)