General Question

crunchaweezy's avatar

How do I download a file from FTP at a certain time?

Asked by crunchaweezy (1733points) September 5th, 2009

Say I wanted to back up a certain directory on my server at a certain time every day, week, month, etc. Can I do this with Automator or something similar?

Thanks alot :)

Observing members: 0 Composing members: 0

2 Answers

robmandu's avatar

- 1 - Of course, if you’re running Mac OS X 10.5 or later and have an 2nd hard drive, then Time Machine will do the job most transparently.

- 2 - Software like Carbon Copy Cloner (free) or SuperDuper! (paid) can do the job for you. They have builtin scheduling preferences.

- 3 - If you want develop something yourself, you can look into learning about rsync, which is what CCC uses behind the scenes to do its work. And yah, you could develop a workflow in Automator or, if you want to keep it low-level in UNIX-land, consider using cron as your job scheduler instead.

robmandu's avatar

Oh, and to most directly answer your question…

The tricky part of scripting FTP is getting the userid/password passed in. That’s because UNIX systems (like Mac OS X) use /dev/tty for the input. So, you just need to tweak your shell script slightly to accommodate that.

See this working example.

Now, the drawback to FTP is that it operates in cleartext… even for your credentials! So a network sniffer could pickup your userid/password from the line if someone was suffficiently motivated to try.

Another concern is that, in order for this script to work, you’d need to embed the password in body of the script itself. Any users on your system with read access to that script could then see your “secret” credentials for the remote FTP host.

Neither of those might bother you much, especially if the FTP host is on your local network and you’re the only user on your machine. But it’s something to consider.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther