I've a shell account with a shell provider(OS: FreeBSD 4.11-STABLE). I wanted to ftp a file from my home directory to my c drive on every sunday. I wanted to make this process automated. right now i do manually. Can someone help me pls?
Hi.
I think you should do:
cd C:\TEST
instead of
lcd C:\TEST
Assuming you are running the script on an unix box and the remote is windows.
You could also use $HOME/.netrc
if you do not want to put your usr/pwd in the script. Although I would use ssh with certificates...
Regards.
In that case, are you using "localhost" as the destination server? If so, it should be your Windows' IP/name... I mean if you want to ftp from Linux to Windows, you are ftp-ing to yourself (linux)... I think the script is fine...
There are several quertions from my side
#!/bin/sh
cd /home/user
ftp -n localhost <<!
quote user user
quote pass mypassword
binary
cd C:\TEST
put ftptest.txt
quit
!
here in the script what is localhost.... are you trying to transer file to the local host...I cant get that....UNIX to UNIX
no CD will not work i thind so since lcd "Local CUrrent Directory"...Give the ipaddress in the place of local host amd try it....
chmod 777 ftptest.txt in unix machine....
try with all these and let me know....