Your best friend for file transfer.

Fetch application logoFetch

Close on Mirror Complete; Simultaneous Downloads (9 posts)

  • Started 17 years ago by sstringer
  • Latest reply 17 years ago from Scott McGuire
  • sstringer Member

    I run an Automator task daily that opens a saved Mirror file. In that mirror file, I specified that the transfer should start automatically. What is sorely missing is a counterpart to this checkbox that quits Fetch when the mirror is complete.

    I also find mirroring slow as compared to FileZilla which, I think, opens multiple pipes to the site and performs as many simultaneous transfers as you tell it to (default is 2, I think).

    Othwerise, I love the product. Keep up the great work!

    Posted 17 years ago #

  • guest Registered Member

    Regarding your first question, open the AppleScript Script Editor, hit "Record", then open and run your saved mirror file. Stop recording in the Script Editor, and type "quit" before "end tell" (quitting Fetch wasn't recorded when I set this up). Compile and run the script to check results. Fetch should open to the mirror dialog box, execute the mirror, then quit. Perhaps you can add the quit command in Automator, but I'm on Mac OS 10.3.9 so I use AppleScript. The following script works for me (Note that stray files are deleted in this version):

    tell application "Fetch"
    activate
    open {alias "(your saved Fetch mirror"}
    mirror alias "(your local web site folder):" to url "ftp://(your remote server/webpage" format Automatic with delete strays
    quit
    end tell

    Posted 17 years ago #

  • sstringer Member

    That's great. I returned to the mac on v10.4 after years away in Windows hell. I forgot all about AppleScript!

    Based on your suggestion, here's what I ultimately did (with the hope that this can be a roadmap for others):

    In Fetch, open your site and navigate to the folder that you wish to mirror. Go Remote > Mirror... and set your mirror event up. It is important to make sure the checkbox next to "Run automatically" is UNCHECKED, or this AppleScript will try to run the mirror event twice. Click Save... and save the mirror file somewhere.

    Launch the AppleScript editor and click Record. Open the mirror file in Fetch. Back in the AppleScript Edtior, click the Stop button. Back in Fetch, stop the mirror; there's no need to continue.

    You should now have something like this:

    ***************

    tell application "Fetch"
    activate
    open {alias "Path:to:mirror:file"}
    mirror remote folder "ftp://username :password@ftpsite.com/path/to/folder/in/mirror/file/" to alias "path:to:local:backup:folder:in:mirror:file:" with delete strays
    quit
    end tell

    ***************

    It is important to set a timeout of 0 to avoid the AppleScript from timing out before your mirror event is complete.

    You should now have something like:

    ***************

    tell application "Fetch"
    with timeout of 0 seconds
    activate
    open {alias "Path:to:mirror:file"}
    mirror remote folder "ftp://username :password@ftpsite.com/path/to/folder/in/mirror/file/" to alias "path:to:local:backup:folder:in:mirror:file:" with delete strays
    quit
    end timeout
    end tell

    ***************

    Save the AppleScript as an application and close out.

    Now in Automator, select the finder actions:
    1) Get Specified Finder Items - find your newly created AppleScript application.
    2) Open Finder Items

    Save this as an iCal plug-in and set the event to repeat daily, weekly, or however often you want to run the script.

    End Tell

    ----

    Thanks for your help. I hope this thread helps others automate a mirror task.

    [This message has been edited by sstringer (edited 04-22-2006).]

    [This message has been edited by sstringer (edited 04-22-2006).]

    Posted 17 years ago #

  • guest Registered Member

    Very good, I'm glad I helped reconnect you with Mac-ness. Yes, instructing Fetch to open up the mirror file is redundant; I simply recorded the process of opening up the saved mirror file, etc., and that was the result. Your script is more to the point.

    Your script appears to initiate a mirror download rather than upload, no? Others monitoring this thread should be mindful of which way their files will be moving. I typically modify files locally, start the script, and go get a cup of coffee while Fetch compares and uploads to the remote... Aaahhh.

    Posted 17 years ago #

  • sstringer Member

    Your script appears to initiate a mirror download rather than upload, no?

    Yes, indeed. This script is to *download* a site. In this case, I'm only mirroring an image directory that contains photos uploaded to my site by users. I mirror this into my source tree so that, combined with my source files, the entire local site is synced up with the remote one. I assume this is too much info for most people. =)

    Posted 17 years ago #

  • guest Registered Member

    Right. Different strokes... Life is good.

    Posted 17 years ago #

  • Scott McGuire Administrator

    Hi,

    Sounds like you're all set, sstringer, and thanks for helping out, Philip. Thanks both for the feedback.

    For the sake of completeness, there's also a "Run AppleScript" Automator action - you could put your new script inside it, instead of using Get Specified Finder Items/Open Finder Items actions. Not necessarily better, just an alternative.

    Scott McGuire
    Fetch Softworks

    [This message has been edited by ScottMcGuire (edited 04-23-2006).]

    Posted 17 years ago #

  • sstringer Member

    Originally posted by ScottMcGuire:

    Sounds like you're all set, sstringer

    Despite figuring out this work-around, I think my original feature requests are still valid:

    1) a checkmark closing Fetch upon completion of a Mirror event is still sorely needed. If I had this, none of this AppleScript hoo-ha would be necessary.

    2) The ability to open multiple, simultaneous connections to a site would speed up things tremendously when lots of short read/write operations (such as mirroring) are involved.

    Many thanks for your great product. I look forward to future versions!

    Posted 17 years ago #

  • Scott McGuire Administrator

    Hi,

    Sorry, what I should have said was "it looks like you're all set, for now."

    I have filed your suggestions in our database, and we will consider them for future versions of Fetch. Thanks!

    Scott McGuire
    Fetch Softworks

    Posted 17 years ago #

Reply

  • Or nickname, if you prefer.
  • This will be kept confidential.
  • This is to ensure that you’re a person, not a spambot.