[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
touch --date=TIME argument
From: |
Jeffrey Walton |
Subject: |
touch --date=TIME argument |
Date: |
Sat, 26 Dec 2020 08:06:29 -0500 |
Hi Everyone,
I'm trying to restore filetimes based on the timestamp from a ZIP file.
I can extract the newest filetime from a ZIP with:
unzip -l "${file}" 2>&1 | head -n -3 | tail -n +4 | cut -b 12-27 |
sort -r | uniq | head -n 1
(The head and tail trims away header and footer cruft so only
date/time's remain).
That yields a date/time like:
12-31-1998 23:07
When I plug it into 'touch' it results in:
Setting /var/www/html/crypto30.zip to 12-31-1998 23:07
touch: invalid date format ‘12-31-1998 23:07’
Is there some way to get touch to accept the date/time from the ZIP archive?
Thanks in advance
- touch --date=TIME argument,
Jeffrey Walton <=