Lingon is pretty neat too. I’ve been playing with it. Using your script as a framework, I may well run some other tasks that I’ve been starting with a hotkey as launch daemons instead. I know that Craig uses them all the time. For example, I have a script that uses a USB-controlled PowerKey Pro to power up an external hard disk, runs SuperDuper! to backup my boot partition, waits a bit (do shell script sleep n - much better than delay unless the delay is very short) and then ejects the external drive, waits for that to happen, powers it down from the PowerKey Pro, quits SuperDuper!, and posts a note that it is done.
The PKP, by the way, is a great toy; it’s got 6 USB-controlled outlets and its daemon is scriptable so you can sense whether an outlet is on or off, and you can change it’s state either way. It also has a script scheduler calle iDo, but I’ve not used that. One outlet is always on: the power plug of your computer, and that outlet can be controlled from a telephone tone code. I use the others to power two desk lamps, a small fan, a LaserJet printer, and inkjet printer, and the external drive. I use Scenario to run a script when I wake the machine and another when I sleep it (from keystrokes) that automatically turn on/off lights, printers, etc. if they’re on (ejecting the external first if necessary).
Can you tell that a retired engineer has too much time on his hands? :lol:
I know, Sir, I’m very envious that I can’t use it in Europe with our 240 V voltage.
We already talked about it some months ago. And the effort to handle it with a transformer and plug adaptors isn’t worth while.
Probably why I never use launchd…I’ve yet to need any of that. I just need to launch stuff after hours when no one is around. Lots of scripts for updating this and that, exporting the other, etc. Used to use a GUI-based auto-launcher (forget the name) until it stopped working, then got “more complicated” by using cron with CronniX at the advice of our head tech dude. LOL…my KISS is a notch down from y’all’s–“make script go when grunt not here.”
Take a while is an understatement, Stephan; it’s been running for a minute or so, and if you hadn’t told me it would take a while I’d have killed it by now. I assume it’s the LowPriority true that makes it so slow. Still running. :mad:
launchd appeared in Mac OS 10.4; for folks using 10.3 and earlier, only cron is available.
I myself use cron to schedule a few scripts - all amusing reminder notices. It’s really quite easy - I just typed in “crontab -e” in the terminal and then entered the schedule for my user-level crontab. There’s lots of excellent documentation on this, but it took me a while to discover it
When I upgrade, I’ll definitely be trying out launchd, though.