Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp question

Status
Not open for further replies.

fathead

IS-IT--Management
Apr 13, 2002
154
I want to create a script that will ftp to a remote server, login, then upload a file...how can i do this????
 
Hi I'm doing the same thing,

using a bash script on a Red Hat Linux box.

Can anybody tell me how I can generate a filename which incorporates a timestamp (i.e. so its unique each time its generated) from a bash script?

Heres my FTP stuff:

#!/bin/sh

ftp -inv <<!
open 12.12.12.12
user username password
bin
put filename.ext
quit
 
Hi,

Create 1 variable to get your timestamp. eg

#!/bin/sh

time=`date | awk '{print $4}'`
ftp -inv <<!
open 12.12.12.12
user username password
bin
put filename.ext filename_$time.txt
quit

Timestamp the file was created or timestamp the file is transfer?

feroz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top