View Single Post
  #1  
Old 01-08-2009, 04:42 PM
gfesmire gfesmire is offline
Registered User
 
Join Date: Jan 2009
Posts: 10
Smile Shell script not executing before backup RESOLVED

Hi all,

I'm a newbie at scripting, so please bear with me.

In trying to achieve unattended backups that mount the backup disk (which is a partition on another internal hard drive, the other partition on that drive is always mounted already) before SuperDuper runs, then unmounts the backup disk when the backup is complete, I found some examples of shell scripts to do that. My test run didn't work correctly, here is the log result for the error:

Code:
| 12:20:20 PM | Info | SuperDuper!, 2.5 (84), path: /Volumes/HomeDrive/Applications/Utilities/SuperDuper!.app, Mac OS 10.5.6 build 9G55 (i386)
| 12:20:20 PM | Info | Started on Thu, Jan 8, 2009 at 12:20 PM
| 12:20:20 PM | Info | Source Volume: HomeDrive, mount: /Volumes/HomeDrive, device: /dev/disk3s2, media: ST31000333AS, interconnect: Internal SATA, file system: "Journaled HFS+", OS: N/A, capacity: 681.51 GB, used: 157.86 GB, directories: 53791, files: 317610, ejectable: NO, ACLs: Enabled
| 12:20:20 PM | Info | Target Volume: HomeDriveBAK, mount: /Volumes/HomeDriveBAK, device: /dev/disk2s3, media: ST31000340AS, interconnect: Internal SATA, file system: "Journaled HFS+", OS: N/A, capacity: 681.07 GB, used: 157.53 GB, directories: 53777, files: 317355, ejectable: NO, ACLs: Enabled
| 12:20:20 PM | Info | Copy Mode   : Smart Update
| 12:20:20 PM | Info | Copy Script : Backup - all files.dset
| 12:20:20 PM | Info | Transcript  : BuildTranscript.plist
| 12:20:21 PM | Info | PHASE: 1. Prepare to Copy Files
| 12:20:21 PM | Info | ...ACTION: Preparing HomeDrive
| 12:20:21 PM | Info | ......COMMAND => Verifying the integrity of volinfo.database
| 12:20:21 PM | Info |       volinfo.database OK
| 12:20:21 PM | Info | ......COMMAND => Enabling permissions on HomeDrive
| 12:20:21 PM | Info |       Refreshing Disk Arbitration ...
| 12:20:21 PM | Info | ......COMMAND => Verifying that permissions are enabled for HomeDrive
| 12:20:21 PM | Info |       Permissions on '/Volumes/HomeDrive' are enabled.
| 12:20:21 PM | Info | ...ACTION: Preparing HomeDriveBAK
| 12:20:21 PM | Info | ......COMMAND => Enabling permissions on HomeDriveBAK
| 12:20:21 PM | Info |       Refreshing Disk Arbitration ...
| 12:20:21 PM | Info | ......COMMAND => Verifying that permissions are enabled for HomeDriveBAK
| 12:20:21 PM | Info |       Permissions on '/Volumes/HomeDriveBAK' are enabled.
| 12:20:21 PM | Info | ......COMMAND => Verifying that HomeDriveBAK ACL support matches HomeDrive
| 12:20:21 PM | Info | ...ACTION: Preserving Spotlight state on HomeDriveBAK
| 12:20:21 PM | Info | ......COMMAND => Disabling Spotlight search indexing on HomeDriveBAK
| 12:20:21 PM | Info | ...ACTION: Running shell script superduper_mountdisk.sh
| 12:20:21 PM | Info | ......COMMAND => Invoking Before Copy shell script: /Volumes/HomeDrive/Users/gina/Library/Application Support/SuperDuper!/Shell Scripts/superduper_mountdisk.sh
| 12:20:21 PM | Error | sh: /Volumes/HomeDrive/Users/gina/Library/Application Support/SuperDuper!/Shell Scripts/superduper_mountdisk.sh: Permission denied
| 12:21:38 PM | Error | LOGGED EXCEPTION: FSGetVolumeInfo failed., reason: Unable to retrieve volume information, userInfo: (null)
My shell script (superduper_mountdisk.sh) for mounting the backup disk contains this code:

Code:
#!/bin/bash

# mounts backup partition before running SuperDuper unattended backup

BDISK=`/usr/sbin/diskutil list | awk '$3=="HomeDriveBAK" {print $6}'`
/usr/sbin/diskutil mount $BDISK > /dev/null
I have a similar script to unmount the disk... Can you tell me how to make this work?

Thanks!

Last edited by gfesmire; 01-08-2009 at 09:34 PM. Reason: [added "Resolved" to subject]
Reply With Quote