![](/img/trans.png)
[英]How to rsync files with matching pattern in path by keeping directory structure intact?
[英]how do I create tar file keeping directory structure intact and excluding some files based on the last modified date
find directory1 -type f -mtime -4d | xargs tar -cf your_archive_name
-mtime -4d
: 查找所有在 4 天内修改过的文件
( -mtime 3d
会发现这都是一模一样72小时00分钟00秒前修改的所有文件-这可能是你所要求不是什么)
运行此命令时,请远离目录 1 和目录 2。
添加-z
选项 - tar -czf
- 如果除了存档文件之外,您还想压缩它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.