Hi All,
Once again I need all your help to get things. I am using the following script to login to ftp and pull a particular file.
Code:
#!/bin/bash
ip=192.168.1.10
user=zamo
pwd=zamo1
cd /tmp
ftp -n $ip << inp
quote user $user
quote pass $pwd
put sample1.txt
exit
inp
Now, as am moving forward, I have to make some changes here.
Code:
#!/bin/bash
ip=192.168.1.10
user=zamo
pwd=zamo1
dir_path=/dir1/dir2/dir3
dest_file=myfile
cd /tmp
ftp -n $ip << inp
quote user $user
quote pass $pwd
put $dir_path/($dest_file)_$(date +\%F)
exit
inp
I need to "put" (download) a variable file from the FTP server. As the variables assigned in this script are not working , as it logged inside the FTP. Is there anyway to do this.