Cron job to mount encrypted sparse bundle

Discussion in 'Mac Programming' started by Crash Davis, Sep 18, 2011.

  1. Crash Davis macrumors member

    Joined:
    Feb 23, 2008
    Location:
    Austin, Texas
    #1
    I can run the following command in terminal to mount an encrypted sparsebundle where the bundle password is stored in the keychain.

    Code:
    hdiutil attach '/Volumes/Backup/Mac1.sparsebundle'
    I would like to have that command run on a schedule, so I'm using CronniX to create a cron job with that command. But, when it runs at the scheduled time, nothing happens. When I check the cron daemon mail in terminal, it says the following:

    Code:
    hdiutil: attach failed - Authentication error
    I'm assuming that it isn't able to read the password from keychain? I don't know. Hoping somebody can shed some light on things, or point me in the right direction.

    Thanks
     
  2. willieva macrumors 6502

    Joined:
    Mar 12, 2010
    #2
    You might be able to use -stdinpass in the cronjob line. This will us an unencrypted passphrase, so it's not the most secure method.
     

Share This Page