View Single Post
  #1  
Old 07-07-2008, 02:52 PM
michael.green michael.green is offline
Registered User
 
Join Date: Nov 2006
Posts: 14
shell script after copy "cannot execute binary" error

Some time ago, you helped me to write a couple of scripts that would unmount a network share after SD had finished copying to it.

Now I'm trying the same trick at work: back up my user directory to a sparseimage on a network share. Backing up works great. But I'm running into an error with the scripts to unmount the share.

The script, "RunEjectFacStaff", waits 20 seconds and then runs an AppleScript, "ejectFacStaff", to unmount the share.

Code:
#!/bin/sh
nohup /bin/bash -c "sleep 20; osascript /Users/mjg14747/Library/Scripts/ejectFacStaff" &
The script works when run from the terminal. Check.

The permissions on the text file RunEjectFacStaff are:
Code:
-rwxr-xr-x   1 mjg14747  mjg14747  101 Jul  3 10:17 RunEjectFacStaff
They're identical with the permissions for the similar file on my home machine, where this has been working since 2006. So, check (?).

Then I ask SD to run "RunEjectFacStaff" using the third option under "After copy" in the "Advanced" tab. But, alas, here the checks stop.

Code:
| 11:49:04 AM | Error | sh: line 1: /Users/mjg14747/Library/Scripts/RunEjectFacStaff: cannot execute binary file
In short, things look the same to me but I'm getting different results. So I'm clearly missing something. If you could point me in some possible directions, that would be swell.

Thanks!
Reply With Quote