I am trying to create a script that I can use to transfer file via ftp access from a remote server to my own server(local server) using conjob.
The problem I am having a "bash scripts troubleshooting". Can some one please help me and look at the code and tell the problem and how to fix it.
I am not very good at coding please try to use simple english
This is the script iam trying to use:
#!/bin/sh
filename="/home/www////// "
hostname=" FTP hostname "
username="FTP username "
password=" FTP password "
ftp -un $hostname <<EOF
quote USER $username
quote PASS $password
binary
put $filename
quit
EOF
bash, but your script header invokes Bourne shell: it should be#!/bin/bash, or#!/bin/bash -xif you want to log debug lines. – AFH Nov 15 '16 at 14:34ftp <commandfile– uSlackr Nov 15 '16 at 17:37~/.netrcfor automated transfers, as in this answer, though you'll need to be sure of what account is being used for yourcronjob. Incidentally, on Ubuntuftpdoesn't understand the-uoption. – AFH Nov 16 '16 at 18:29