Cron job to mount encrypted sparse bundle

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

  1. Crash Davis macrumors member

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

    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:

    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.

  2. willieva macrumors 6502

    Mar 12, 2010
    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