|Apr 22, 2005, 09: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, 09: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 10:12 AM.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Scheduling app||James66||iPad Apps||1||Jul 19, 2014 05:57 PM|
|General: Better DND scheduling?||Missjenna||Jailbreaks and iOS Hacks||5||Feb 19, 2014 06:26 AM|
|iPhone: Scheduling Possible?||xybadog||iOS 6||5||Apr 6, 2013 08:33 AM|
|EP Scheduling question||LincolnAthas||Mac Applications and Mac App Store||0||Jun 28, 2012 03:20 PM|
All times are GMT -5. The time now is 09:30 PM.