Automator automatic backup

Discussion in 'Mac Programming' started by sultanoflondon, Feb 18, 2017.

  1. sultanoflondon macrumors 6502

    Dec 3, 2013
    Hi all,

    I have designed an Automator Calendar event like the one in the link below (please check #8). However, when I tested the workflow through Automator for a test trial, I got the attached dialog box error message.

    Can anyone explain why?

    Thank you!

    Attached Files:

  2. kryten2 macrumors 6502a

    Mar 17, 2012
    There's little information provided. What is the whole workflow? What link? Did you try to copy the file manually through the Finder? You can try this snippet. Post the error if it fails.

    set theFile to choose file
    set theFolder to choose folder
    tell application "Finder"
        duplicate theFile to theFolder
    end tell
  3. sultanoflondon thread starter macrumors 6502

    Dec 3, 2013
    Thank you for your reply.

    I have attached a screenshot of the Automator workflow that I designed.

    With reference to your AppleScript, I have no experience in AppleScript and so I am unsure as to whether this would be able to replicate what I have (tried to) design in Automator.

    Effectively, what the Automator workflow is designed to do is copy a folder, with all its contents, to a certain destination folder every time a Calendar event is triggered, which I have set to every Sunday.

    Thank you for your help.

    Attached Files:

  4. chown33 macrumors 604

    Aug 9, 2009
    Two things come to mind.

    1. Look at the results of each step (action). Make sure it's what you expect.

    2. We can't tell what the "iMac Automator backup" item in step/action #3 (Copy Finder Items) actually is. If it doesn't exist, or it isn't a folder, or you don't have permission to write there, then that step/action is almost certain to fail. Maybe the results from that step will show more detail. You should confirm that the item in that step is what you expect, and it exists.

    Your first post shows an error alert that identifies a particular Numbers file.

    If that item is the first item in the list of items processed by the "Copy Finder Items" step, and there's a problem with the destination (the "iMac Automator backup" item), then I would expect that first attempt to copy a file to fail.

    On the other hand, if that Numbers file is NOT the first item in the list, and/or there are other items that did copy successfully to the destination, then the destination item (the "iMac Automator backup" item) would seem to exist and be allowable as a destination. This would suggest a problem with the original item, though it doesn't suggest any particular reason.
  5. sultanoflondon thread starter macrumors 6502

    Dec 3, 2013
    Since I got that error message, I erased the external HDD on which the folder "iMac Automator backup" is. Then I reformatted it using MS-DOS FAT format and this seems to have solved the problem. I think the external HDD was formatted as a Mac OS X (Journaled) before.

    However, the Automator workflow still works for hours at a time, usually more than five. This may be understandable, as the folder I am trying to copy is over 300 GB in size and the interface of the external HDD is USB 2.0.

    To my knowledge, my Admin account (from which I run the Automator workflow) has rights to read and write on to the external HDD.

    I am beginning to think that the best way to implement this may be to write an AppleScript and use a repeating Calendar event to trigger it...
  6. chown33 macrumors 604

    Aug 9, 2009
    The format shouldn't have mattered. It's possible the HFS+J format would have enforced ownership, but it doesn't do that by default for removable media. This can be changed in Finder's Get Info window for the drive/volume.

    The name of the volume may have mattered. If it's not unique, say if all your externals are named "Untitled", then that could be a cause. Hard to say without more details, and since you've reformatted, those are likely gone.

    The FAT formats (FAT16, FAT32) have an absolute file-size limit of 4GB. They simply won't allow files larger than that. So make sure you have no such files to be backed up, and never will. Otherwise you're in for another failure in the future.

    The ExFAT format DOES support files larger than 4GB. So if that's what you have, it should be fine.

    Five hours seems a bit long for 300 GB over USB 2.0. You should be able to see the disk I/O rate using Activity Monitor, while a copy is in progress.

    I don't know what mechanism Copy Finder Items is using to perform the copy. If it's the command-line tool 'cp', then it should be able to max out whichever data channel is slower (input or output). If it's something else, well, maybe not.

    If you're always backing up the same thing, overwriting each time, then the 'rsync' command-line tool may give markedly better performance, because it will only copy things that changed.

    Get Info on the external HDD in Finder, and look at the permissions. Or paste this command into a Terminal window:
    Then copy & paste the complete output into a post here, if you're not able to understand what it tells you.

Share This Page

5 February 18, 2017