Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread Display Modes
Old Apr 22, 2005, 09:07 AM   #1
macrumors member
Join Date: Mar 2004
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.
bunkre is offline   0 Reply With Quote
Old Apr 22, 2005, 09:45 AM   #2
robbieduncan's Avatar
Join Date: Jul 2002
Location: London
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

ftp servername_or_ip << FTP_EOF
user username password
cd directory_name
get file
Replace servername_or_ip, username, password, directory_name and file with the required stuff. If you want to get whole directories (this assumes you have the correct local directories) you need something like


ftp servername_or_ip << FTP_EOF
user username password
cd directory_name
lcd directory_name
mget *
lcd changes your local directory, prompt turns off prompting, mget is multiple get.

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.
mkdir -p $LOCAL_BASE
for dir in $DIRS ;\
do \
cd $dir\
lcd $dir\
mget *\
If you replace the variables (contained in <> above) with the correct details (the list should be space separated, i.e. 'dir1 dir2 dir3') then this will ftp to the given host and copy each of the directories specified to the directory specified in LOCAL_BASE. Note that unless LOCAL_BASE is absolute it will be relative to the current directory. So if your user is called fred setting LOCAL_BASE /Users/fred/Desktop would result in a set of directories on freds desktop.

Last edited by robbieduncan; Apr 22, 2005 at 10:12 AM.
robbieduncan is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
FTPS (with TLS) from command line brijazz OS X 0 Jun 22, 2011 07:00 AM
FTP client that allows bookmark/site sync aerowave Mac Applications and Mac App Store 1 May 19, 2011 04:11 AM
Your holiday gift problems solved! Steve Jobs action figure Blue Velvet Community Discussion 31 Nov 23, 2010 11:45 PM
Aliens Attacking the Earth! Check out the newest iPhone action game! developer.ost iPhone and iPod touch Apps 0 Nov 8, 2010 05:57 AM
Automated / Scheduled FTP software? Craigy Web Design and Development 4 Jul 17, 2008 02:00 AM

All times are GMT -5. The time now is 09:17 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013,, LLC