Your best friend for file transfer.

Fetch application logoFetch

Remove Files Via Automator (10 posts)

  • Started 7 years ago by sharingsunshine
  • Latest reply 7 years ago from Scott McGuire
  • sharingsunshine Member

    I am creating a workflow to dowload files that are on my server. On this server I have 3 domains. Currently, I have a .gz file copy of each of my MySQL databases in a folder called backups. This is created by a shell script I paid to have done. I want the automator to then I copy of those files, 7 specific ones, to my desktop and then delete all of the files in the individual folders on each domain once the download is completed. My workflow has the following:

    Get Specified Fetch Items
    Get Fetch Folder Contents
    Download Fetch Items - this is going to my desktop, quite nicely

    ************* at this point I want to go to the different domains and their backups folder and empty it out. But because I am working with 3 domains I am not sure how to do this.

    Filter Fetch Items - Item type is file
    Filter Fetch Items - name contains.gz
    Delete Fetch Items

    Thanks,

    Randal

    Posted 7 years ago #

  • Scott McGuire Administrator

    Hi Randal,

    We'd like some more information in order to help answer your question.

    So all of your domains are hosted on the same server, but each is in a different folder, is that correct?

    And you want to go into each domain's folder, and delete the backup files that are in it?

    And all the files you want to delete are .gz files?

    Thanks,

    Scott McGuire
    Fetch Softworks

    Posted 7 years ago #

  • sharingsunshine Member

    Hi Scott,

    Thanks for your help. Yes, they are in a different folder and they all are .gz files and I want to delete all of the files in each folder.

    Randal

    Posted 7 years ago #

  • Scott McGuire Administrator

    Hi Randal,

    Thanks for the additional information.

    The problem is that the "Download Fetch Items" action does not output Fetch Items, which the "Filter Fetch Items" action needs; instead the "Download Fetch Items" action outputs files/folders (Finder items). So you get an error when a "Filter Fetch Items" action is placed after the "Download Fetch Items" action, because it doesn't understand the input.

    So you need a way to get your original list of Fetch items back, so you can perform more actions on them. If you're on Mac OS X 10.5 or later, you can use Automator variables to accomplish this.

    Insert a "Set Value of Variable" action after the "Get Fetch Folder Contents" action. Give your variable a name (such as "myfetchitems"). (The Get/Set Value of Variable actions are in the Utilities category of actions.)

    Then insert a "Get Value of Variable" action after the "Download Fetch Items" action. Choose your variable if it wasn't automatically selected for you.

    And then - this is important - Control-click (Right-click) on the "Get Value of Variable" action's title bar and choose "Ignore Input" from the contextual menu that pops up. If you don't do this, the Finder Items from the "Download Fetch Items" will be passed along in addition to the Fetch Items, and you'll still get an error.

    If you're on Mac OS X 10.4, you'll need a different approach to accomplish this, since 10.4 doesn't have Automator variables. Let me know if that's the case and I'll explain the alternate approach.

    Otherwise, let me know how the above goes.

    Thanks,

    Scott McGuire
    Fetch Softworks

    Posted 7 years ago #

  • sharingsunshine Member

    Hi Scott,

    This isn't seeming to work and I am on Leopard. I have provided the automator log below. I double checked that the ignore input was checked too.

    2010-03-08 18:51:11 -0500: Run Shell Script completed
    2010-03-08 18:51:12 -0500: Conversion from Text (com.apple.cocoa.string) to Fetch Items (com.fetchsoftworks.Fetch.FetchItem) completed
    2010-03-08 18:51:21 -0500: Get Specified Fetch Items completed
    2010-03-08 18:51:21 -0500: Get Fetch Folder Contents completed
    2010-03-08 18:51:21 -0500: Set Value of Variable completed
    2010-03-08 19:06:39 -0500: Download Fetch Items completed
    2010-03-08 19:06:39 -0500: Get Value of Variable completed
    2010-03-08 19:06:39 -0500: Conversion from Files/Folders (com.apple.applescript.alias-object) to Fetch Items (com.fetchsoftworks.Fetch.FetchItem) completed
    2010-03-08 19:06:39 -0500: The action “Filter Fetch Items” was not supplied with the required data.
    2010-03-08 19:06:39 -0500: Filter Fetch Items completed
    2010-03-08 19:06:39 -0500: The action “Filter Fetch Items” was not supplied with the required data.
    2010-03-08 19:06:39 -0500: Filter Fetch Items completed
    2010-03-08 19:06:39 -0500: The action “Delete Fetch Items” was not supplied with the required data.
    2010-03-08 19:06:39 -0500: Delete Fetch Items completed
    2010-03-08 19:06:40 -0500: Workflow completed

    Thanks for your help,

    Randal

    Posted 7 years ago #

  • Scott McGuire Administrator

    Hi Randal,

    It might be easiest if you emailed your workflow to us so we could take a look at it. (We won't be able to use it to connect to your server, but we can see what order things are in and what the settings are.)

    So could you please do the following?

    * Select the workflow in the Finder.
    * Go to the File menu, and choose Compress.
    * Email the resulting zip file to us at bugs@fetchsoftworks.com .

    We'll take a look and see what further advice we can offer.

    Thanks,

    Scott McGuire
    Fetch Softworks

    Posted 7 years ago #

  • sharingsunshine Member

    Hi Scott,

    I have sent it. Thanks for your help.

    Randal

    Posted 7 years ago #

  • Scott McGuire Administrator

    Hi Randal,

    We've received the workflow and we're looking it over.

    Could you please tell us which version of Mac OS X, and which version of Fetch, you're using?

    Thanks,

    Scott McGuire
    Fetch Softworks

    Posted 7 years ago #

  • sharingsunshine Member

    I am using 10.5.8 and Fetch 5.3.1

    Thanks,

    Randal

    Posted 7 years ago #

  • Scott McGuire Administrator

    Hi Randal,

    Thanks for that information. This appears to be a limitation in the Fetch 5.3.1 Automator actions that has been fixed in Fetch 5.5. I have followed up with you via email about upgrading.

    Thanks,

    Scott McGuire
    Fetch Softworks

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