|
Linux zip program's -d -tt option deletes all files from zip archive
I have recently started working with Linux server (Oracle Enterprise Linux 5.5 which is same as Red Hat Linux 5.5). I have worked on Linux but not extensively. Whenever I run into a problem, Google search always finds me more that one right answers on this forum. Today I decided to register and post a question to which I could not find any answer.
Here is my problem.
I am using Linux zip utility to zip the logs into a zipped archive, say logs.zip. To delete logs older than 30 days from the zip file, I wanted to use the -d -tt options but these are not working as I expected.
My understanding of -d and -tt option is that -d will delete files from archive and -tt mmddyyyy will delete only files older than a certain date. However, when I use the -d -tt mmddyyyy options, all files are deleted from the archive irrespective of the file modification date.
-d
Remove (delete) entries from a zip archive.
-tt mmddyyyy
Do not operate on files modified after or at the specified date, where mm is the month (0-12), dd is the day of the month (1-31), and yyyy is the year. The ISO 8601 date format yyyy-mm-dd is also accepted.
Please let me know if my understanding of the -tt option is incorrect. If -tt option does not work the way I expected it, how else can I achieve my objective without resorting to unzip/delete/zip again process?
Thanks in advance for the help.
|