PDA

View Full Version : make before and after shell scripts job-specific?


Dan Lester
12-23-2012, 06:07 PM
I was pleased to stumble on the strategy by "TíNíT Luoma" a couple of years ago for mounting a backup volume before cloning, and then unmounting it. See

http://tntluoma.com/shell-scripts/superduper-script-automatic-mount-unmount/

That keeps from having open volumes that make my system want to spin up disks even when I'm not using those disks. This strategy just runs a "mount" shell script before cloning, and an "unmount" shell script after cloning.

One frustration with this, however, is that SuperDuper always wants to run the SAME shell scripts, no matter what the clone job is. So If I want to clone to different volumes (say, a daily backup, and another a weekly backup, or backups to different disks), I don't seem to be able to do it. I can only mount/dismount my "daily" volume OR my "weekly" volume". It would be handy (and sensible) to have the "before" and "after" shell scripts one selects be specific to the particular job being scheduled.

Maybe there is a way to do this that I just haven't figured out?

dnanian
12-23-2012, 06:22 PM
You can, using saved settings, but there's no need, since the script is passed parameters that can let you determine the volume names.

Note, though, that SuperDuper! does the mount/unmount automatically. However, this is broken on schedules in Mountain Lion (see the blog).

Dan Lester
12-23-2012, 09:49 PM
I guess I don't understand. How is the script passed parameters? The volume name is what we're supposed to edit into the script.

If I'm setting up to run a shell script "mount-daily" before my scheduled daily backup starts ("mycomputer" to "daily backup volume"), and I save that as a scheduled task, and then I go set up another task to do a weekly backup, that shell script that I then select -- "mount-weekly" replaces the first one in the scheduled task.

I'm not aware that SuperDuper does the mount/unmount automatically. I'm using 10.5.8 and, as far as I can tell, the volumes that SuperDuper clones to stay mounted. SuperDuper never tries to unmount them when done. Well, at least if the volume was mounted when SuperDuper launches, it stays mounted when the clone is done.

dnanian
12-23-2012, 11:42 PM
The User's Guide explains. Have you reviewed that?

Dan Lester
12-25-2012, 02:20 PM
Thanks. I will admit that I didn't see in the Users Guide about passed parameters. Nice!

But I also just assumed that the target volumes had to be pre-mounted in order for Super Duper to work. Tried it last night with those volumes unmounted. I got up in the morning to find that it worked! So indeed, SuperDuper mounts volumes it needs to access, and unmounts them when done. I always just *assumed* that those volumes had to stay mounted. That's a real pleasure to find out that they don't.

I've used SuperDuper seamlessly for at least five years, and I'm continually delighted by it, as I gradually learn more about it.

This all being the case, I'm trying to understand what the script by "TíNíT Luoma" was for. I thought that script was to mount before clone, and dismount after clone. But if SuperDuper already does that, what's that script for??

dnanian
12-25-2012, 05:03 PM
I think he thought he was doing a mount that we were already doing. The before/after scripts run too late, and too early, for mount/unmounts...