LeMOGO's picture

I've been exploring the various TK appliances. While working with vTiger, I had to setup cron a job fro emails to be generated. I did so from webmin and all looks right. However, the cron did not seem to run. When I upgraded to the latest version of vTiger because I thought that the one in the TK appliance was too old and the newer version would probably work. After upgrading with a data migration, I experienced the same problem.

I recreated the cron and it still would not run. When running it manually, the software generates the emails as it should, which led me to realize that even though the cron job is set, it does not get launched.

Is there anything I need to do?

LeMOGO's picture

I used webmin to configure the cron jobs and did not relize that the "All" selection in all fields did not work. I changed to "Selected" and CTL+clicked every 5 mins. Works now.

Jeremy Davis's picture

But something else for the record, is that often cron doesn't know the path to scripts you wish to run. Just because something runs from the commandline doesn't necessarily mean that cron will be able to find it. You can import your paths (ie the root user's) into cron, but I've never actually tried that, I just use the full path for scripts I wish to run.

Dan Kelley's picture

I read what you said regarding scripts that run successfully from the command line, but not from cron. That seems to be my issue. I have a PHP script that I can run ok from the command line, but when I run it from cron I get an error.   I used to get the same error before I installed CURL and got it working from the command line by getting the CLI php.ini settings right... but now I am stumped as to why cron is giving me the error from the output command window.

Any ideas?  thanks!

Dan Kelley's picture

Actually I found out that I was wrong.... I can only run it from the directory that the PHP file is in from the command line. So it must be a path issue I guess...

Now Im not really sure where to look... I am attempting to get a script written using the Amazon MWS API to pull orders from Amazon.... the API uses several PHP files as includes and uses ".." as part of the path to find those files.

I will try modyfing the PHP files and putting in the direct path and see if it helps.

Dan Kelley's picture

Just found out I could issue two commands in one line with cron so I simply changed to the correct directory first and then put my script at the end like so: "cd /var/www/MyPath/ &&  php MyScript.php"

Its working now!  :)

Maybe this will help someone else in the future... Happy New Years everyone! 

Add new comment