我有一个脚本,并且只想复制在星期天创建的文件。find /data/src/ -iname *.bak -mmin +3 -type f -exec cp {} -n -p -v /data/dest \;
在7.、14.、21.、28.创建的替代文件。
也许我们可以使用这个选项的文件名?
文件名如:
db1_backup_2021_10_27_233001_1582165.bak
db1_backup_2021_10_28_233001_1582165.bak
db2_backup_2021_10_28_233001_1582165.bak
...
多谢了!
1条答案
按热度按时间rqdpfwrv1#
可以使用find命令:
或者:
请记住,这不是创建日期,而是最后修改日期
作为脚本文件的名称:
您可以尝试使用文件名执行此操作: