FTP from one unix server to another and add date extension to file
Posted on 2004-10-29
I have a problem where I'm backing up a file by using ftp to transfer from one unix server to another. This is going to be done every night so when the file is moved I need the date extension to be added to the file so that it doesn't overwrite the previous nights backup. So far I have:
#copy from live to processing directory then compress
cp /live_directory/abrtest /process_directory/
expect_version -exit 5.24.1
set file [lindex $argv 0]
set file1 "000001"
set timeout 1200
#create a new ftp session and put the file on the test server
spawn ftp xxx.x.x.xx
send "cd /test_directory\r"
send "put "abr$file\r"
It's at the stage above that I'd like to somehow add a date extension when the "put "abr$file\r" command is used. Can anyone help me with this problem?