I'm running vTiger 7.0 and I noticed on the first of the month, none of my invoices were created. I then took a look at the Scheduler and noticed that the "Last scan started" and "Last scan ended" fields show that none of the cron jobs had fired in days. The cron jobs are scheduled to fire in 15 minute intervals, with the exception of "RecurringInvoice" which runs every 12 hours.
If I visit /myvtigerinstall/vtigercron.php, the cron jobs will all fire but nobody wants to have to manually run cron jobs!
Has anyone had a similar issue before with vTiger?
I'm not exactly sure how to troubleshoot this error effectively and efficiently. I've checked permissions and they all seem to be in order.
If you've installed vTiger CRM on a dedicated server, you maybe have added a line in linux crontab so that the cron executes...
For instance :
* * * * * sh home/vtiger/vtigerCRM5/apache/htdocs/vtigerCRM/cron/vtigercron.sh
If the cron doesn't launch automatically, it means it's not launched by the cron bot...
Vtiger minimum cron frequency is 15 minutes.
Add the following line in crontab
*/15 * * * * wget -O- --spider "http://vtigercrmurl/vtigercron.php" >/dev/null 2>&1
or use the following free services
https://www.easycron.com/
https://cron-job.org
Related
I have the Laravel schedule command triggered in the crontab as:
* * * * * php /home/forge/site/artisan schedule:run
This is set via Forge.
Then, in app/Console/Kernel.php I'm triggering my job to run hourly:
$schedule->job(new GetRecentArtists())->hourly();
But it's still running every minute.
My understanding was that the artisan command needs running every minute so that job schedules can then be checked to see if the job needs triggering as per its' specific schedule.
Update
I've tried restarting the queue as suggested in the comment by Sahidul, and have confirmed that none of the built-in schedules (hourly, daily, etc) prevent it from running every minute.
When I remove the schedule from the crontab and run it via php artisan schedule:run, I get 'No scheduled commands are ready to run' but the task runs anyway.
This was a red herring. I had my log message showing the job as running in the __construct method of the job, rather than in the handle method.
The job is constructed when the scheduler runs, then added to the queue to be executed as per the schedule - so the construct method was being called immediately, but the job wasn't actually being handled until the scheduled time.
I'm running a cron job on a direct admin server that runs every minute and every minute the connections/processes almost triples to about 90 from about 30. They die right away and they drop back down to about 30.
https://laravel.com/docs/5.8/scheduling#scheduling-queued-jobs
I'm using the scheduler cron job
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
What would be creating all these connections?
I also have a problem when restarting the queue with php artisan queue:restart.
A sleeping process starts that lasts forever, crashing the server eventually so I have to manually kill it.
edit here's a screenshot
I think your job is having error. Try php artisan [your job command]. Check if it is running fine. Besides, don't you have a cron table to record your job status?
I'm trying to make Laravel automatically handle the emailing queue but can't make the task scheduler working. The problem is like:
I already got jobs successfully in the database table, and in Kernel.php:
$schedule->command('queue:work')->everyMinute();
on the remote server I've run this command under the project folder:
* * * * * php artisan schedule:run >> /dev/null 2>&1
But the scheduler still refuse to work, as job still remains in the table. If I manually run
artisan queue:work
the email is sent then.
What am I getting wrong here? Many thanks!
Firstly I would suggest you to not use laravel's command scheduler.
Pros and cons of using laravel's task scheduler:
pros
Your cron task gets embedded to your code. So if you change your server you don't need to remember which all cron tasks you had.
cons
Let's say you have several other cron tasks. Task T1 runs every minute but task T2 runs every day while task T3 runs every Tuesday. Now to just check this you will be running a daemon which will check if every minute of you have any task in queue schedule. Also your queue should respect each jobs and their respective timings.
Instead what you can do is create separate commands for every task. And run cron jobs for them.
But even if you wanted to do what you were doing already or want to know why your cron task was not running, then here is what you were forgetting "running the artisan command in your project directory".
* * * * * cd path_to_your_laravel_project & php artisan schedule:run
I have worked on creating a plugin for setting a cron job. However it runs only when a person visits it. Can we link it with linux so that it opens the site and the cron job is done without anyone visiting the page. How can we use wget for this if the wordpress is set up locally?
Do this following steps to get your server cron going, enable server cron from plugin is not possible as of now (as i understand).
Disable wp-cron.php
You can disable WP-cron by modifying the wp-config.php (located in the folder where WordPress is installed). Open the wp-config.php file, add a new line after
define('DISABLE_WP_CRON', true);
Set Up a Linux Cron
Warning: It is important that you familiarize yourself with how cron
jobs work. You need to have a working knowledge of Linux commands
before you can use cron jobs effectively.
To set up a Linux cron job:
Log into your cPanel.
In the Advanced section, click Cron jobs.
Under Add New Cron Job, select the time interval. HostGator recommends that you do not set the interval lower than 15 minutes.
Set the cron command to the following, replacing yourwebsite.com with your actual domain name:
wget -q -O - http://yourwebsite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
The above command tells the Linux server to run wp-cron via wget, which will trigger the wp-cron.php script to do it's job on your schedule instead of on each page view.
Click Add New Cron Job to set the cron.
In order to test out the new cron, simply wait for the elapsed time period for the cron to run. In the event that the cron does not run, please review the steps listed above to ensure that you have completed all steps correctly.
CREDITS:
http://support.hostgator.com/articles/specialized-help/technical/wordpress/how-to-replace-wordpress-cron-with-a-real-cron-job
You can schedule a cronjob.
$ crontab -e
*/1 * * * * curl -I http://example.org/wp-cron.php?doing_wp_cron
I have installed the elysia cron module and setup the cron job.
So far I'm running cron jobs mannually. And it is quite time consuming because I have other things to do than run cron every 2 hours. I read the handbooks on cron configurations, but didn't get much, since I'm not a PHP literate person.
How can I make my drupal run cron automatically??? So that I don't have to come back to my site every 2 hours.
You can use the crontab. Usually this can be accessed on your server by running crontab -e in the shell and then adding an entry to specify how frequently to update your site. For example,
0 * * * * wget -O - -q -t 1 http://{your_drupal_server}/cron.php
would run every hour. Replace {your_drupal_server} with the url of your server. The command assumes you have wget installed as well.
These sites may be helpful:
Drupal's page on setting up crontab -
https://www.drupal.org/node/23714
Wiki's page on cron -
http://en.wikipedia.org/wiki/Cron