ftp copy: preserve source file date stamp


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers ftp copy: preserve source file date stamp
# 1  
Old 02-16-2005
ftp copy: preserve source file date stamp

Is there any way to preserve a file's create/mod date stamp when it is "put" via ftp (or even using Fetch) to a Win2K server and a SunOS 5.8 server? For example, if I copy a file with a create/mod date of "01/15/2005 3:36 PM" to my Win2K or SunOS ftp server, the date stamp will change to the date/time of when it was copied. I hate that. I want the copied file to keep it's original date stamp. Any advice?

Thank you!!
James
# 2  
Old 02-16-2005
Look if this can help

You may need to preserve the original creation date and access permission mode of the copied file in the new file. As shown in the following example, the -p option enables you to preserve the original creation date and time and file access permission of YTD_sum in the file, year-end:

% rcp -p /usr/reports/YTD_sum moon:/usr/acct/year-end

or use scp.

Also see

--mdtm
Use the MDTM command to get the remote time. The default is to take the times from the directory listings. This doesn't work if the server implements an inferior listing format (most do) and doesn't send time stamps in universal coordinated time (UTC). The damage caused by this is limited to file time stamps being wrong by a few hours. This option makes ftpcopy send a MDTM command for any file it might want to download. The drawback is that this eats performance: ftpcopy usually sends just one command for a complete directory its traverses. With the --mdtm option it has to send an additional command for any file. This option was added in version 0.3.10.

Last edited by thumsup9; 02-16-2005 at 03:24 PM..
# 3  
Old 02-16-2005
Thank you, thumbsup9. I don't administer either one of the ftp servers that I'm copying files to, and I only have ftp access to them. So, it looks like I'm just going to have to live with it changing the date. Oh well.
-James
# 4  
Old 02-16-2005
Quote:
Originally Posted by cassj
Thank you, thumbsup9. I don't administer either one of the ftp servers that I'm copying files to, and I only have ftp access to them. So, it looks like I'm just going to have to live with it changing the date. Oh well.
-James
Can you tell me more about it.Do you have any "SITE OPTIONS" box like we have it in WSFTP.
If yes,
go to "SESSION"
try checking the boxes beside
--Preserve filetime on upload
(MDTM support required)
and
--Preserve filetime on download

in other words

To presever the filetime stamp on either uploads or downloads:
From the Connect Site Manager select edit for the corresponding site and go to "Transfer" and check the box for " Preserve filetime on upload...." and/or "Preserve filetime on downloads".
# 5  
Old 02-16-2005
one more option if you still want to try using ftp.

tar those files in machine1 and ftp the tar file to machine2 and
untar that tar file on machine2.

You preserve the attributes of timestamps for those files.
# 6  
Old 02-16-2005
Quote:
Originally Posted by bhargav
one more option if you still want to try using ftp.

tar those files in machine1 and ftp the tar file to machine2 and
untar that tar file on machine2.

You preserve the attributes of timestamps for those files.
I agree with bhargav,that does save the attributes.thx for reminding me that.
well,i hope he has access to those servers.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Set date and time stamp of one file to another

Hi I use "touch -t xxxxxxxx" command to set date/time stamp of a file. My requirement is to read the date/time stamp of a file and apply it to another file. Is there anyway to do it simple instead of manually taking date/stamp of first file? TIA Prvn (2 Replies)
Discussion started by: prvnrk
2 Replies

2. UNIX for Advanced & Expert Users

How to copy a file from remote server and preserve timestamp

Hi How to copy a file from remote server and preserve timestamp. Please not, i have to pass username and password to connect to the remote server in the shell script. Can this be achieved with simple ftp ? are there any options in ftp ? Thanks (4 Replies)
Discussion started by: skumar75
4 Replies

3. UNIX for Advanced & Expert Users

Automated SCP script passing password to preserve source file timestamp

Hi My requirement is i want to copy files from remote server to the local server and also i need to preserve the timestamp of the remote file. By using scp -p , it is working fine in the interactive call but it is not preserving he file timestamp when i use it in the non interactive scp call... (1 Reply)
Discussion started by: skumar75
1 Replies

4. Shell Programming and Scripting

append date time stamp via ftp script

I have searched several thread and not found my solution, so I am posting a new qustion. I have a very simple script on an AIX server that FTPs 2 files to a MS FTP server. These 2 files are created on the AIX server every hour, with a static name. I need to FTP the files to the MS server, but... (1 Reply)
Discussion started by: sknisely
1 Replies

5. Shell Programming and Scripting

how to copy an alertlog file from a particular time stamp?

Hi, Can any one tell me how to copy an alertlog file from a particular time stamp using shell script? Thanks (3 Replies)
Discussion started by: suman_dba1
3 Replies

6. UNIX for Dummies Questions & Answers

Copy all the files with time stamp and remove header,trailer from file

All, I am new to unix and i have the following requirement. I have file(s) landing into input directory with timestamp, first i want to copy all these files into seperate directory then i want to rename these files without timestamp and also remove header,trailer from that file.. Could... (35 Replies)
Discussion started by: ksrams
35 Replies

7. UNIX for Dummies Questions & Answers

How to Zip the files from date Stamp to end date Stamp

Hi, I need to zip the list of files using from date Stamp to end date Stamp, How can I filter and make FromDate_EndDate.gzip? any idea? (1 Reply)
Discussion started by: redlotus72
1 Replies

8. Shell Programming and Scripting

Date Stamp on new file

Dear Gurus, I'm trying to move a number of files from one directory to another directory with a new date stamp. This is my script: #! /bin/csh Today_Date=`date +%Y%M%D` mv /usr/TRS/data/TS* /usr/TRS/backup/TS*.${Today_Date} when i run the script i'm getting the following errors: mv:... (14 Replies)
Discussion started by: lweegp
14 Replies

9. Shell Programming and Scripting

creating a new file with date stamp

Hi, can any one tell me how to achieve this...I will input the path and file name and it should rename it to current date and time... this is what I tried... #! /usr/bin/sh set -x cd /info_stg/vul/Scripts TODAY_DATE_TIME=`date +%Y%m%d%H%M%S` IN_FILE_PATH=`cat file.txt | awk -F, '{... (2 Replies)
Discussion started by: mgirinath
2 Replies

10. UNIX for Dummies Questions & Answers

File date and time stamp

I have to capture the creation date and time stamp for a file. The ls command doesn't list all the required information. I need year, month, day, hour, minute and second. Any ideas... (1 Reply)
Discussion started by: Xenon
1 Replies
Login or Register to Ask a Question