The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: ftp script
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 02-09-2007
ahmedwaseem2000 ahmedwaseem2000 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Bangalore
Posts: 219
Quote:
Originally Posted by user`
still no luck, i've tried #rm commands and it says
usage: ftp host-name [port]


Code:
#!/bin/bash 
USER=test 
PASSWORD=test12345 
cd /home/test/logs 
tar zcvf backup.tar.gz test.log* 
rm test.log* 
COMMANDS=$(cat << EOF 
ftp  -n  41.220.71.162  
$USER 
$PASSWORD 
cd /home/test2/public_html/backup
prompt off
put backup.tar.gz 
exit 
EOF) 
echo $COMMANDS > commands 
ftp < commands 
#rm commands
You are using the command FTP twice remove one of them