I am trying to zip files using last modified date and time with following shell command in linux.
zip -rt $(date +"%Y-%m-%d:%H:%M:%S") destination.zip source_documents
Eg
zip -rt 2015-03-24:17:14:39 destination.zip source_documents
It does not works. it takes whole day files.
Following the man page you need to use the time format mmddyyyy
. The command should look like this:
zip -rt $(date +"%m%d%Y") destination.zip source_documents
which gives (today):
zip -rt 03242015 destination.zip source_documents
由于zip -t
不会考虑一天中的时间,因此让我们find
工作吧,例如
find source_documents -newermt "2015-03-24 17:14:38" | zip -@ destination
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.