Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am dynamically appending cron tasks to the user crontab

The tasks seem to be getting adde, crontab -e looks like:

*/10 * * * * /bin/sh /Users/john/Kiosk/app/content/
@reboot /usr/bin/open /Users/john/Kiosk/startup.command

Trouble is that it appears to be having no effect.

The content of startup.command:

cd /Users/john/Kiosk/app && /usr/bin/python -m SimpleHTTPServer &
sleep 5 && open http://localhost:8000

What am I getting wrong?

share|improve this question

migrated from Jun 14 '13 at 12:08

This question came from our site for professional and enthusiast programmers.

Do not use relative paths, buth full ones. Also with binaries.

Then, your line should be

*/10 * * * * /usr/bin/sh /home/<username>/Kiosk/app/content/
@reboot open /home/<username>/Kiosk/startup.command
share|improve this answer
Sure! It was a typo. Can also be /bin/sh, you can know it typing which sh. – fedorqui Jun 14 '13 at 11:23
Hmm, that's all changed, but the reboot is certainly still having no effect! – Mild Fuzz Jun 14 '13 at 11:43
Have you tried changing open to /bin/open (or... which open result)? – fedorqui Jun 14 '13 at 11:44
@reboot /usr/bin/open /Users/john/Kiosk/startup.command is the command, which works when put straight into the terminal, but not on reboot – Mild Fuzz Jun 14 '13 at 11:50
I have added more content into the question, hopefully this will assist you. – Mild Fuzz Jun 14 '13 at 12:11

Taking the open command away did the trick

@reboot yourscript.command
share|improve this answer

The default path is /usr/bin:/bin, and tildes do work in the user crontab, so this should work:

*/10 * * * * bash ~/Kiosk/app/content/

Have you tried replacing with something like a say command for testing it?

@reboot works for me when restarting but not when logging out and back in. @reboot open /test.txt didn't work but * * * * * open /test.txt did.

You could also save a plist like this as ~/Library/LaunchAgents/simplehttpserver.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN>
<plist version="1.0">

It can be loaded with launchctl load ~/Library/LaunchAgents/simplehttpserver.plist or by logging out and back in.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.