|Apr 22, 2005, 10:07 AM||#1|
newbie: scheduling FTP actions
(I'm really new to applescript)
How hard of a task would it be to write an applescript that will go and grab specific folders from a server via FTP, or even better, schedule it to grab them every week or so? Am I better off scripting an app like Transmit?
My brother is a unix/linux preacher and wants be to us wget, but I don't know **** about command line.
|Apr 22, 2005, 10:45 AM||#2|
wget is not good for ftp! It's really for http. I would personally recommend using the command line ftp client. Write a shell script to do whatever you want then schedule with cron.
A basic ftp script would look something like
#!/bin/sh ftp servername_or_ip << FTP_EOF user username password cd directory_name get file FTP_EOF
#!/bin/sh ftp servername_or_ip << FTP_EOF user username password cd directory_name lcd directory_name prompt mget * FTP_EOF
Cron is pretty easy to setup. Do a Google search for that. Save the script somewhere and make it executable (chmod u+x <scriptname>). You may want to add a line to the start of the script (above the ftp) to change the local working directory.
The reason I think this is better is that you don't need to buy Transmit! I don't think AppleScript can do FTP on it's own. If you give me some more details I can write a better script for you.
Edit: Been playing. This is better.
#!/bin/sh FTP_USER=<USERNAME> FTP_PASS=<PASSWORD> FTP_HOST=<HOSTNAME> DIRS='<LIST_OF FILES>' LOCAL_BASE=<LOCAL_DIR> export FTP_USER FTP_PASS FTP_HOST DIRS LOCAL_BASE mkdir -p $LOCAL_BASE cd $LOCAL_BASE for dir in $DIRS ;\ do \ (\ ftp $FTP_HOST << FTP_EOF\ user $FTP_USER $FTP_PASS\ cd $dir\ lcd $dir\ prompt\ mget *\ FTP_EOF\ )\ ;\ done
Sponsor me to cycle 100Km round London in the dark
Last edited by robbieduncan; Apr 22, 2005 at 11:12 AM.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|FTPS (with TLS) from command line||brijazz||OS X||0||Jun 22, 2011 08:00 AM|
|FTP client that allows bookmark/site sync||aerowave||Mac Applications and Mac App Store||1||May 19, 2011 05:11 AM|
|Your holiday gift problems solved! Steve Jobs action figure||Blue Velvet||Community Discussion||31||Nov 24, 2010 12:45 AM|
|Aliens Attacking the Earth! Check out the newest iPhone action game!||developer.ost||iPhone and iPod touch Apps||0||Nov 8, 2010 06:57 AM|
|Automated / Scheduled FTP software?||Craigy||Web Design and Development||4||Jul 17, 2008 03:00 AM|
All times are GMT -5. The time now is 01:57 AM.