geeks question about FTP commands?

Does exactly what it says on the tin. Some of the nonsense contained herein may be very loosely related to The Sisters of Mercy, but I wouldn't bet your PayPal account on it. In keeping with the internet's general theme nothing written here should be taken as Gospel: over three quarters of it is utter gibberish, and most of the forum's denizens haven't spoken to another human being face-to-face for decades. Don't worry your pretty little heads about it. Above all else, remember this: You don't have to stay forever. I will understand.
Post Reply
User avatar
Quiff Boy
Herr Administrator
Posts: 16795
Joined: 25 Jan 2002, 00:00
Location: Lurking and fixing
Contact:

anyone used command-line FTP in anger?

i need to transfer a stack of files from a windows box to a unix box (its a hp box if that matters) via command-line FTP.

i have a .bat file that logs into the ftp server and runs the following commands:

Code: Select all

prompt
literal site umask 012
mput c:\ftp\Sending\*.log
the PROMPT command toggles the command prompt
the LITERAL command sets the default CHMOD values for the files about to be sent
the MPUT command sends the files

i need to preserve the datestamp of the files, but at the moment they seem to end up with the transfer-time set as their last-modified date.

i want to keep the original datestamp. :|

any ideas how i do this? i've seen it done with ftp client software (ie: a checkbox you can tick to preserve the date/timestamp) but i'm using the microsoft command line ftp client and cant seem to be able to do it.

is it a server-side setting (ie: a LITERAL SITE command?) or is it a client side command (ie: a switch or something i need to put on the end of the MPUT line?) :?:

bloody thing. :urff:
What’s the difference between a buffalo and a bison?
User avatar
Karst
Slight Overbomber
Posts: 1452
Joined: 04 Nov 2002, 00:00
Location: Belfast

Is there no way you can just dump it on the server?

8)
User avatar
Quiff Boy
Herr Administrator
Posts: 16795
Joined: 25 Jan 2002, 00:00
Location: Lurking and fixing
Contact:

Karst wrote:Is there no way you can just dump it on the server?

8)
nope, gotta be ftp.

firewalls, checkpoint nonsense etc :roll:

after further digging, its looking like you cant preserve timestamps during upload... only download (which used a slight frig to ascertain the remote file's timestamp and then does a TOUCH or similar on the local file)

the solution would appear to be to TAR the local files up (TAR preserves timestamp info), ftp the TAR file, then use a LITERAL SITE command to UNTAR the log files and then delete the TAR.

:urff:
What’s the difference between a buffalo and a bison?
User avatar
Karst
Slight Overbomber
Posts: 1452
Joined: 04 Nov 2002, 00:00
Location: Belfast

Didn't know TAR did that. I know that when zipping it and dumping it on my Win2000 server the date remains. Not that I'm really bothered about that. Lucien might know more about this btw.

8)
User avatar
hallucienate
Overbomber
Posts: 4602
Joined: 17 Apr 2002, 01:00
Location: /\/¯¯¯¯¯\/\
Contact:

Karst wrote:Didn't know TAR did that. I know that when zipping it and dumping it on my Win2000 server the date remains. Not that I'm really bothered about that. Lucien might know more about this btw.

8)
All my servers run Linux. I maintain a couple of Win 2000 servers reluctantly, but that mostly involves doing the Windows Update once a week. :roll: :roll:

tar can be very useful (it also keeps file permissions), but we don't use FTP very much as most of our uploads are linux to linux we use UUCP or scp. :von:
User avatar
jenzi-benzi
Utterly Bastard Groovy Amphetamine Filth
Posts: 694
Joined: 24 Nov 2002, 00:00
Location: between hot metal...

your TAR solution is good as long as you can do tar commands via ftp, which i think is impossible, besides S-FTP (kinda SSH) :wink:
Post Reply