命令基本格式是:
tar cvzf TARGET SOURCES -N TIME
例如:
tar cvzf foo.tgz /bak -N "2004-03-03 16:49:17"
记住全备份的时间f_time和上一次增量备份的时间i_time;(现在的办法是以job为单位记录这两个时间: " [JobName] [F_TIME] [I_TIME] '\n' ")
全备份: tar cvzf foo.tgz /bak
增量备份: tar cvzf foo.tgz /bak -N i_time
差量备份: tar cvzf foo.tgz /bak -N f_time
tar 中几个开关的简介:
The c option specifies that an archive file is begin created.
The p option preserves permissions; file protection information will be remembered.
The N or newer option does an incremental backup and only stores files newer than DATE.
The f option states that the very next argument will be the name of the archive file or device being written.
The z option specifies that an gzip file will be created.
The u option can APPEND more files to a tarball file.
注意:-u 开关并不是增量备份,而是往原有的 tar 包里面添加新的文件。
更详细信息参看:http://www.faqs.org/docs/securing/chap29sec305.html