Your best friend for file transfer.

Fetch application logoFetch

Mirror and excluding sub directory (4 posts)

  • Started 8 years ago by EBEAR
  • Latest reply 8 years ago from Scott McGuire
  • EBEAR Member

    Hello All,

    Does anyone no how to exclude sub directories from a fetch mirror?

    Or is there a method to run several mirror files sequentially?

    Thanks for the help.

    Posted 8 years ago #

  • Scott McGuire Administrator

    Hi,

    No, sorry, currently there is not a way to exclude subdirectories from a Fetch mirror.

    You can use AppleScript to run several mirror operations sequentially; please let us know if you'd like more information about how to do that.

    However, we'd also like to hear why you want to exclude certain subdirectories. If it is because they cause permissions errors, we may have another solution for you that does not involve multiple mirror operations; please let us know.

    Thanks,

    Scott McGuire
    Fetch Softworks

    Posted 8 years ago #

  • EBEAR Member

    Hello Scott,

    I am mirroring from a internal company webpage located in another location. This site is an SFTP and requires logging into the site. Most of the information is in several languages and I only want one specific language. Mirroring was the easy way to clone site and delete what I did not need.

    Can you send examples with applescript? If I can use this it might be a good workaround.

    Thanks

    Eric

    Edited 8 years ago #

  • Scott McGuire Administrator

    Hi Eric,

    One way to create an ApplesSript to do what you want is to use AppleScript's record feature - with it AppleScript watches the actions you perform in Fetch and generates a script that matches those actions, so you can just run the script to repeat them later on.

    To do this:

    * Open Fetch.
    * Open the Script Editor application (on Mac OS X 10.6, in the Utilities folder inside the Applications folder; on Mac OS X 10.5 and earlier, in the AppleScript folder inside the Applications folder).
    * A new blank AppleScript document should appear. If it doesn't, go to the File menu and choose New.
    * Click the Record button in the toolbar of the AppleScript document.
    * Switch back to Fetch.
    * Setup the first Mirror you want to do, and click the Mirror button.
    * You can either wait for the Mirror to finish, or stop it soon after it starts; the Mirror doesn't need to run to completion for the purpose of setting up the script (the fact that you stopped the mirror will not be recorded in the script).
    * Setup the next Mirror you want to do, and click the Mirror button. Wait for it to finish, or stop it soon after it starts.
    * Repeat setting up Mirrors and clicking the Mirror button until you've done all the mirrors you want.
    * Switch back to the Script Editor.
    * Click the Stop button in the toolbar.
    * Save the script. You'll see it contains a list of all the Mirrors you've done.
    * Then, when you want to run the same set of mirrors, open and run the script.

    You need to be careful not to do anything unnecessary in Fetch while recording the Mirror operations, because most other actions you perform will also become part of the script. You may need to switch folders to set up the Mirror operations, and those folder changes will be recorded, but that's okay.

    You should be sure to save the password for the FTP site in your keychain, so that Fetch can retrieve it automatically when you run the script.

    If you're somewhat familiar with AppleScript and URLs and folder paths, you could also try to write your own script manually (although personally, I find I often make typos when trying to do that and so recording may be a better option). Here is an example of an AppleScript that performs two different Mirror operations:

    tell application "Fetch"
    activate
    mirror remote folder "ftp://username@:ftp.example.com/folder1/" to alias "Macintosh HD:Users:jsmith:Desktop:mirror1:" without delete strays
    mirror remote folder "ftp://username@ftp.example.com/folder2/" to alias "Macintosh HD:Users:jsmith:Desktop:mirror2:" without delete strays
    end tell

    As you can see, each line contains the FTP URL of the folder you want to Mirror, and the folder on your Mac it should be mirrored to.

    I hope this helps get you started, please let us know if you have further questions.

    Thanks,

    Scott McGuire
    Fetch Softworks

    Posted 8 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.