ftp and cron scheduling

AxsDeny

Registered
Here's the situation. i have a file that gets automatically updated via a cron job every few hours. After it gets updated, i want to have it automatically get uploaded to an ftp site. I want to have the full command line switch so that I can use a cron to schedule this as well...

something along these lines:

ftp serverURL --user user:passwd --upload-file filename

any ideas?
 
Take a look at curl (man curl). It should do what you need. If you need more sophisticated behaviour, expect would be the way to go. It doesn't ship with OSX, but should be very easy to build.

hope this helps....

-alex.
 
curl -T filename -u user:pw ftp://server.com/filename

This works ok. Actually you should be able to omit the last "filename" and have the uploaded file default to the local filename, like:

curl -T filename -u user:pw ftp://server.com/

But when I do this I get some errors from curl (pointer deallocation) , but it still seems to work though. I have reported this.
 
Back
Top