Guys, I have an issue I have not been able to figure out. I’ve been trying to schedule a Cron Job and I can’t find a way for it to fire. It used to show Start/Stop when testing on shell, but now all I get is NO OUTPUT GENERATED… I’m trying to set up CJ from my CRM using this string:
sh /home/USER/CRM URL/cron/vtigercron.sh
But, I can’t seem to make it work. Would any one have any suggestions and how it would work?. It used to work like this. Thanks
O.K. I’m beginning to think this is a bug in Webmin. By searching on this topic, no one seems to have reported this. I’ve tried several ways to get this to work and no luck. Logs do not show any errors. I see email in root directory. This was never an issue before.
You can check the crontab that Webmin produced (which crontab it appears in depends on the user and type of job) to be sure it’s reasonable. Most are in /etc/cron*, but user crons live in files in /var/spool/cron.
Usually when I find a cron job isn’t working, it’s because the script can’t run with the environment cron has.
It’s just cronjobs, as they’ve always been. We don’t touch the cron implementation…you’re dealing with the standard stuff.
I suspect your script doesn’t do what you think it does. You see it running in the cron log, right? So we know the cron scheduling portion of things is right. The only thing left is a problem with the script or a problem with the environment in which the script runs. Is the file executable? Does it expect things to be in the PATH that cron won’t have setup? Any other environment dependencies?
If it were me, I’d add some logging to the script to make sure it’s actually starting and then see where it’s failing.
I don’t think I understand the question. cron is part of your OS. It’s there before we even get installed.
You should be troubleshooting your script, not cron. You see the command run in the cron log; you know cron is doing its job. The problem you need to solve is why the script doesn’t do what you expect it to when it is run by cron.
I note that the command is being run as root, which seems maybe wrong? Maybe it should run as whatever user does vtiger things? (I dunno. I dunno how you set this up or what it’s supposed to do.)
But, again; the most common problems with scripts that work when you run them yourself from the command line but don’t when run from cron are that the environment is wrong (wrong user, wrong PATH, some missing library path, etc.) or the permissions are wrong (again wrong user).
So, to confirm: The script works when you run it yourself from the command line, right? That’s the first troubleshooting step, always.