In article <58e878bc-acf5-4c69-ab50-d0b035159bd7@m36g2000hse.googlegroups.com>, -hh <recscuba_google@huntzinger.com> wrote:
> I'm trying to develop a script that can be scheduled to run 1x/day to > automate the process of logging into a domain and using FTP, select > and download the newest access log(s) into a local storage > repository. > > The reason I mention the above is that I'm open to any reasonable > method of implimenting this...eg, command line, etc. I haven't done > all that much research specific to see if someone has already written > a shareware app or script to do this exact task. > > What I have found is Automator. In Automator, its pretty > straightforward to invoke my FTP application (Transmit) and by using > its 'synchronize' feature, get it to download any new files to the > intended local destination. What's kind of nice about this approach > is that if the script fails to run for some reason, the next time it > runs, it will pick up howerver many new access log files exist. > > The problem I'm having is that when the Automator "script" runs, it > starts Transmit and selects the correct account for the FTP, but then > pauses because it wants the account's password to be entered. Once > the password is manually entered, the rest runs OK to completion. > Obviously, having this manual entry point of the password entry > defeats the basic purpose of having a script that can run > unattended. > > Question is: what do I need to add/change/etc to have the script be > able to enter the Account password for the FTP application to not > hang? > > My general thoughts are that the password for Transmit might need to > go into the Keychain, but I don't see the obvious method with which to > do this. > > Suggestions? Comments? Alternative approaches? > > > -hh
The old-school way to do this is from the command line. If you do it with GUI-based tools, you have to be logged in for them to work.
There's a well-behaved tool already installed on your system called curl which can do http, ftp, sftp, and a bunch of other protocols. And it does this all from a single command line with arguments so you don't have any additional prompts. You can put it in a crontab entry or use launchd which is best managed by Lingon: