Trying to set up a system that will cause all my Movable Type posts to be mirrored here on LJ for friends lists. Have everything working from the command line just fine, but it just won't work from the crontab no matter what I do
( Read more... )
Well, again, the crontab is definitely running - I can see it in the logs, and other items in the crontab run just fine. It's just this item that fails silently. Thanks though.
cron debugging
anonymous
September 17 2002, 12:04:26 UTC
If you got a bash/sh/ksh on your system, you can use the following. It helps a lot...it's from another Unix, but it should work on OS-X (maybe with some mods). You run this script, then run your program, and voila, it runs in the cron environment. I use it a bunch.
Re: cron debuggingshackerSeptember 17 2002, 14:52:04 UTC
Very interesting. When I execute this (without even following it with the script I want to run), I get this at the end of the output:
/Users/shacker/bin/crondebug.sh: rm: command not found /Users/shacker/bin/crondebug.sh: sh: command not found
In other words, it has NO awareness of paths on my system. Does that mean I need full paths to every single little thing in the perl script? There's got to be a better way...
Just changed my password so it's not using any special characters, still won't run from cron.
Running the script from the command line, I just noticed something else strange - the entries it creates aren't quite in the form you mentioned last night. Rather than
Excellent, I'll try the update tonight (busy at work today). Yep, I'm running the crontab on my home OS X box, which is also www.betips.net - cron run several other tasks that go fine, and the script does show up in the syslog.
Comments 19
Reply
Reply
Reply
#!/usr/bin/bash ( ... )
Reply
/Users/shacker/bin/crondebug.sh: rm: command not found
/Users/shacker/bin/crondebug.sh: sh: command not found
In other words, it has NO awareness of paths on my system. Does that mean I need full paths to every single little thing in the perl script? There's got to be a better way...
Thanks for this!
Reply
As long as you've got a sane PATH, your script (and any processes it spawns) should be fine.
Reply
Reply
(The comment has been removed)
Running the script from the command line, I just noticed something else strange - the entries it creates aren't quite in the form you mentioned last night. Rather than
[blog link ] [item link]
I get
[blog link ] [http://shacker.livejournal.com/]
So there is no permalink for the reader to follow even if I could get this running from cron. Any idea what's up with that?
Reply
(The comment has been removed)
Thanks for your work on this!
Reply
* * * * * /bin/sh -c "/Users/shacker/bin/blaggupdate.sh"
If you have the #!/bin/sh in as the first line of blaggupdate.sh, just make sure it's executable and leave off the /bin/sh part in crontab.
Reply
(The comment has been removed)
Reply
Leave a comment