Does anybody know how can I forward login, password and some commands to ftp command?
I'm making a bash script that is intended to put some files on a remote server via ftp periodically.
I tried something like this:
printf "%s\n" "login" "password" "cd some_directory;" "put some_files;" "bye;" | ftp my_remote_server;
but it just does not work.
printf "%s\n" "login" | ftp my_remote_server;
does the job, but offcourse not whole job. This way I have to enter password and all the commands manually. That is not what I need.
Can anybody help me prepare printf command to make this work, please?
I apreciate all your answears.
Thank you in advance.