 |
 |
ftp script wanted!
|
 |
|
 |
|
Forum Regular
Join Date: Oct 2000
Location: solna, sweden
Status:
Offline
|
|
Im looking for a script that can, with timed intervals. download/empty an ftp. It should be able to tell if an objekt is finished uploaded or not.
hopefull...
|
|
The real MacMicke™
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 1999
Location: Georgetown, Demerara, Guyana
Status:
Offline
|
|
Hi macmicke,
If you haven't already done so, check out Apple's URL Access Scripting, one of the AppleScript Guidebook Modules. It installs as an additional help "book" in the Help Centre of Mac OS 8.6 or 9.x, and contains several tips and sample scripts for automating downloads & uploads via the commands in the 'URL Access Scripting' OSAX introduced in Mac OS 8.6.
The module also contains examples of retrieving and parsing FTP directory listings, which might allow you to use a size-based technique to determine whether a file has been completed uploaded. In other words, you could try using a 'repeat' loop to continually retrieve & parse the directory listing (with a suitable 'delay <n>' command after each retrieval+parsing to allow enough time for size updates, if any). If the size of any file was still increasing, then you would just continue looping; otherwise, you would immediately break out of the loop with an 'exit repeat' command. Note that some FTP servers report the initial size of an uploading file as 0, but then do not refresh it until the file has been completely uploaded; in that case, you could simply test whether each file's size is > 0. Nevertheless, parsing the directory listing might also allow you to detect whether additional new files were still coming in.
Once you've written/tested/saved the script, you could then use 'iDo Script Scheduler' or a similar program to run it at the desired interval(s). 'iDoSS' is distributed in the 'CD Extras -> AppleScript Extras' folder of the Mac OS 8.6 & 9.x CD-ROMs. It's also available online directly from Sophisticated Circuits' download page, or via Apple's AppleScript Extras package.
Regards,
--Paul
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Oct 2000
Location: solna, sweden
Status:
Offline
|
|
Thanx a million....
I will soon be scripting like crazy :-)
|
|
The real MacMicke™
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 1999
Location: Georgetown, Demerara, Guyana
Status:
Offline
|
|
Hi again,
I wish you very happy scripting! [Alhough, I just realised that you also wanted to empty the FTP server's directory after dowloading everything, right? I doubt whether 'URL Access' currently has commands for deleting remote files. It seems that even Mango Tree Software's TCP/IP Scripting Addition commercial OSAX won't let you do that, at least not easily. So, you may need to use a scriptable FTP client such as Dartmouth College's Fetch (freeware for .edu/.org folks; otherwise, $25 Single-User) or Interarchy's self-named Interarchy (shareware, $25 Single-User). And, of course, if you're ever so lucky as to have an FTP server that's actually an AppleShare IP server or is AFP-compliant, you could probably just mount the remote directory as a volume on your desktop and use the standard scriptable Finder commands to copy & erase files! ;-)]
Do let us know how things turn out.
Regards,
--Paul
[This message has been edited by Paul Crawford (edited 11-01-2000).]
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|