AppleScript To Backup To External HD

Discussion in 'Mac Programming' started by ncmason, Mar 8, 2007.

  1. macrumors regular


    Feb 27, 2007
    Can someone please give me an AppleScript that will backup my Home folder onto a backup folder I made on my External HD?

  2. macrumors 603


    Jul 23, 2002
    Fuquay Varina, NC
  3. thread starter macrumors regular


    Feb 27, 2007
    Carbon Copy Cloner

    I have used CCC before and really didn't have a great experience with it. Do you know of any other solutions besides CCC? I would like it to atleast be an AppleScript.

    Thanks again,
  4. macrumors 6502


    Feb 17, 2007
    Vallejo, CA
  5. macrumors 65816


    Dec 9, 2006
    North-East, UK
    I use Intego Personal Backup X4. It does exactly what you described.
  6. macrumors member

    Mar 15, 2004

    You don't need an Apple Script, OS X comes with an old command line utility called rsync. For a really basic backup, just run "rsync -a /Users/username /Volumes/externalharddrivename/" in your terminal.

    Note the lack of a trailing / on the first path, this is important. A trailing / means "the contents of" rather than the folder itself. So with a trailing /, all of the contents of your home folder would be dumped onto the root of the external hard drive, without a copy of the folder itself.

    Run the same command again, and only the files that have changed will be moved. By default, files you've deleted in your home folder will not be removed from the backup, add "--delete" right after the "-a" if you want deleted files to be removed from your home folder. rsync is very powerful, if you want more information, run "man rsync" in your terminal.
  7. macrumors G4

    Jan 5, 2006
    Redondo Beach, California
    Just use rsync

    It's trivial. Just one line.

    But don't copy your data to an external drive use "rsync". It will copy over only the files that have changed since the last time you sync'd. It will go much faster. It is the one line script:

    Of course you need to replace "username" and "mydisk" with real names. If you want to automate this to run say ever night then you can give the name of your backup script to "crontab".

    For more info, from the terminal type "man rsync" and "man crontab". If you read up you will see that rsync is pretty smart and can "sync" data over a network or across the Internet if you ask it to. But going to an external drive is easy.
  8. macrumors newbie

    Mar 20, 2007
    MyRsyncBackup 0.1

    Rsync indeed is a very reliable solution - try my AppleScript as frontend for rsync. It's nice cause you can output stats to growl.
    Use it in combination with "Do something when". Just follow the instructions on my page.

    Hope that helps.

    PS. I'm working on a more sophisticated version which should be easier to handel..

Share This Page