Bulk change file modification dates

July 14th, 2010 - 05:09 am ET by Derek Turner | Report spam
I have RTFM and STFW.

Before doing a fresh Lucid install I backed up my /home to a FAT32 USB
disk attached to my router.

I've installed Eclipse and Aptana to work on my website, a copy of which
is in /home.

Eclipse will not save any modified files, returning "Failed save,
negative time"

On investigating I find that all the files restored from the back-up have
the date Thu 24 October 1940 (!) which is causing the problem.

Googling I get the suggestion to use touch but much confusion as to what
parameters to use. I've never used touch from a command-line and don't
want to cock things up. man touch seems not to mention recursive.

So, to touch every file recursively in a folder and its sub-folders and
give it the present date and time I should type what exactly?

Many tia
Derek.
email Follow the discussionReplies 10 repliesReplies Make a reply

Similar topics

Replies

#1 Martin Beenham
July 14th, 2010 - 05:21 am ET | Report spam
Derek Turner wrote:
I have RTFM and STFW.

Before doing a fresh Lucid install I backed up my /home to a FAT32 USB
disk attached to my router.

I've installed Eclipse and Aptana to work on my website, a copy of which
is in /home.

Eclipse will not save any modified files, returning "Failed save,
negative time"

On investigating I find that all the files restored from the back-up have
the date Thu 24 October 1940 (!) which is causing the problem.

Googling I get the suggestion to use touch but much confusion as to what
parameters to use. I've never used touch from a command-line and don't
want to cock things up. man touch seems not to mention recursive.

So, to touch every file recursively in a folder and its sub-folders and
give it the present date and time I should type what exactly?

Many tia
Derek.



cd <folder>
find . -exec touch {} \;

or

find <folder pathname> -exec touch {} \;

You may need to prefix the command with sudo if you don't have permissions.

HTH


martin-dot-beenham-at-hotmail-dot-co-dot-uk
Replies Reply to this message
#2 Derek Turner
July 14th, 2010 - 05:38 am ET | Report spam
On Wed, 14 Jul 2010 10:21:48 +0100, Martin Beenham wrote:


cd <folder>
find . -exec touch {} \;

<snip>

HTH



It certainly did! I really must take time out to learn regular
expressions :) Any pointers to a good place to start?

Thank you very much for your very quick and most helpful reply. It worked
like a charm. Now away to fire up Eclipse again. Gedit does most of what
I want but zen coding for it is much less complete than for Aptana. Talk
about using a sledge-hammer to crack a nut...

Thanks once again,
Derek.
Replies Reply to this message
#3 John F. Morse
July 14th, 2010 - 06:24 am ET | Report spam
Derek Turner wrote:
On investigating I find that all the files restored from the back-up have
the date Thu 24 October 1940 (!) which is causing the problem.




You must have missed the booming voice announcement coming from the
Bermuda Triangle: "All your dates are belong to us." ;-)

Another reason to use rsync for backing up files -- or archive them
first into a tarball.

http://www.answers.com/topic/october-24-1 ;-)


John

When a person has -- whether they knew it or not -- already rejected the Truth, by what means do they discern a lie?
Replies Reply to this message
#4 Huge
July 14th, 2010 - 08:18 am ET | Report spam
On 2010-07-14, Martin Beenham wrote:
Derek Turner wrote:
I have RTFM and STFW.

Before doing a fresh Lucid install I backed up my /home to a FAT32 USB
disk attached to my router.

I've installed Eclipse and Aptana to work on my website, a copy of which
is in /home.

Eclipse will not save any modified files, returning "Failed save,
negative time"

On investigating I find that all the files restored from the back-up have
the date Thu 24 October 1940 (!) which is causing the problem.

Googling I get the suggestion to use touch but much confusion as to what
parameters to use. I've never used touch from a command-line and don't
want to cock things up. man touch seems not to mention recursive.

So, to touch every file recursively in a folder and its sub-folders and
give it the present date and time I should type what exactly?

Many tia
Derek.



cd <folder>
find . -exec touch {} \;

or

find <folder pathname> -exec touch {} \;



That would probably have run faster if you'd done;

find <folder pathname> -exec touch {} +


Today is Setting Orange, the 49th day of Confusion in the YOLD 3176
Open are the double doors of the horizon, unlock'd are its bolts
Replies Reply to this message
#5 J G Miller
July 14th, 2010 - 09:58 am ET | Report spam
On Wed, 14 Jul 2010 09:09:53 +0000, Derek Turner wrote:

Before doing a fresh Lucid install I backed up my /home to a FAT32 USB
disk attached to my router.



As a tar file I hope.

On investigating I find that all the files restored from the back-up
have the date Thu 24 October 1940 (!) which is causing the problem.



Oh maybe not then. Backing up a a Linux file system to an MS-DOS
file system tends to lose your file permissions and correct ownerships.
Replies Reply to this message
Help Create a new topicNext page Replies Make a reply
Search Make your own search