开发者

Tar files in one location

At 10 A.M files are like below say in one of the location

A.log,B.log

Tar file should contain A.log and B.log. Tar file name should be like archival_file__oror_datetimestamp.tar

At 11 A.M if开发者_如何学Python files are like below

A.log,B.log,C.log

Now the tar file which is getting created now should not contain A.log and B.log it should contain C.log only


If I correctly guess the intention of your question you might want to do something like

# 10AM:
tar -cf /path/to/tarfile/archival_file__oror_10AM.tar /path/to/logfiles/*.log

# 11 AM
tar -N /path/to/tarfile/archival_file__oror_10AM.tar -cf /path/to/tarfile/archival_file__oror_11AM.tar /path/to/logfiles/*.log

The second command will only put files newer than archival_file__oror_10AM.tar into the new archive.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜