0

I need to build a shell script to run daily & upload certain files to an FTP. I thought I'd use FTP, but I'm really not sure how to use FTP in a shell script being run by a cron job.

Can anyone give me an insight to how I'd upload a file view FTP in a command?

Thanks for your time.

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by sknake
1

You could create a script:

#!/bin/bash
ftp -n 10.2.1.2 <<!
user "username" "password"
put /tmp/upload.txt upload.txt
bye
!

Sample usage:

sk@svn2:/tmp$ cat ftp.sh
#!/bin/bash
ftp -n 10.2.1.2 <<!
user "username" "password"
put /tmp/upload.txt upload.txt
bye
!
sk@svn2:/tmp$ ./ftp.sh
Votes + Comments
Answered!
0

Happy to help :)

Please mark this thread as solved if you have found an answer to your question and good luck!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.