[SunHELP] Copying Files with date before 1.1.1970


Wed Feb 26 10:28:13 CST 2003


Michael,

You could use a for loop to first copy the file(s) then use the touch
command to set the modification date and finally remove the original file
and rename the new file back to the original name.

Here is an example of what a script to do this might look like.  Give it a
try.

#!/bin/sh

for FILE in `ls`
do

    cp -p ${FILE} ${FILE}.new # Create a new file with same owner/perms

    touch -r ${FILE} ${FILE}.new # Set the modification date/time using
original file as example

    rm -f ${FILE} # Remove the original file

    mv ${FILE}.new ${FILE} # Return the file to it's original name

done

Randy Linton 
EDS - AHSMC - Lansing NOC Leader
Unix VooDoo Specialist.
mailto:randy.linton at eds.com

-----Original Message-----
From: Michael Karl [mailto:mk at lexcom-net.de]
Sent: Tuesday, February 25, 2003 7:16 PM
To: sunhelp at sunhelp.org
Subject: Re: [SunHELP] Copying Files with date before 1.1.1970


Thank you,

does anyone have/know a script/tool, which change only creation-dates
before 1.1.1970 during copying files from one server to another?

Regards Michael

> man touch
> 
> 
> On 2/25/03 18:57, "Michael Karl" <mk at lexcom-net.de> wrote:
> 
>> Hi,
>> 
>> I've a Solaris7-Server (over 560gb of files) with some files/directories
>> (only 2-5.000 :-(?) which have a wrong creation-date. (From 1904 to
1968).
>> (I saw files created by Adobe Illustrator 9 in 1962 - whoooow!)
>> 
>> This Solaris7-Machine is a Helios-EtherShare/PCShare-Server. The corrupt
>> creation-date-files are from Mac- and PC-Clients.
>> 
>> Now, I must transfer these 560gb to a new Solaris8-Server.
>> Every Mac-/PC-Client-, Solaris7 -> Solaris8-access (ftp, cpio, cp, rcp,
>> ufsdump, copying via Helios EtherShare or PCShare etc.) doesn't copy
>> these files/directories with creation-date before 1.1.1970 (the birthday
>> of unix-time).
>> 
>> I'm thinking Solaris 7 has a bug, which accept these wrong
creation-dates.
>> But Solaris 8 didn't have this bug anymore. What should I do ?
>> 
>> There are some tools to modify the creation-date ... but that's a
>> really stupid job ... modifying each files/directory ...
>> 
>> Any hints ?
>> 
>> Thanx Michael
>> _______________________________________________
>> SunHELP maillist  -  SunHELP at sunhelp.org
>> http://www.sunhelp.org/mailman/listinfo/sunhelp
_______________________________________________
SunHELP maillist  -  SunHELP at sunhelp.org
http://www.sunhelp.org/mailman/listinfo/sunhelp


More information about the SunHELP mailing list