# Help with scheduled jobs!

**URL:** <https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982>\
**Category:** Maintaining my Dolibarr\
**Tags:** Cron, Issue, Windows, Scheduled-Jobs, v12\
**Created:** [December 27, 2020, 7:40pm UTC](https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982 "2020-12-27T19:40:47Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![sac](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/sac/32/3790_2.png) [@sac](https://www.dolibarr.org/forum/u/sac)\
**Post date:** [December 27, 2020, 7:40pm UTC](https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982/1 "2020-12-27T19:40:47Z")

</div>

Can someone provide a proper documentation for setting up scheduled jobs in Dolibarr.  
It has not been documented anywhere and is very confusing with the need to call the script externally.  
I have set it up once successfully. But when I’m trying to do it for a second time from scratch, it fails.  
The maintenance of Dolibarr using these scheduled jobs are important for removing temp files and for SQL backup.

I use Dolibarr version 12.0.4

---

<div class="post-metadata">

**Author:** ![ksar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ksar/32/514_2.png) [@ksar](https://www.dolibarr.org/forum/u/ksar)\
**Post date:** [December 28, 2020, 9:33am UTC](https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982/2 "2020-12-28T09:33:30Z")

</div>

Hi,

> [@sac](#):
>
> But when I’m trying to do it for a second time from scratch, it fails.

Could you describe a bit what is the issue ?

---

<div class="post-metadata">

**Author:** ![trekmorris](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/t/dfb087/32.png) [@trekmorris](https://www.dolibarr.org/forum/u/trekmorris)\
**Post date:** [December 30, 2020, 4:24am UTC](https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982/3 "2020-12-30T04:24:21Z")

</div>

Hi Sac

```
 Just try as below :

```

1.Download dolibarr-12.0.4.zip from dolibarr download page .  
2.Unzip the file .  
3.Find the file " cron\_run\_jobs.php " in " scripts/cron/ " .  
4.Copy " cron\_run\_jobs.php " to your website root folder .( For windows system it will be in your xampp folder and if your system is linux , it will be in /var/www/html/ . )  
5.Open " cron\_run\_job.php " by any editor .  
6.Edit line 45 [require\_once $path."…/…/master.inc.php";"] to [require\_once $path.“master.inc.php”;].  
Note: You also could copy the cron\_run\_jub.php to the other folder , but you will need to change the path to real path .  
7.Go to your dolibarr Home \>\> Setup \>\> Modules/Application setup \>\> SCHEDULED JOBS.  
8.Enable " SCHEDULED JOBS " module if you have not enable it .  
9.Create " Security key for URL to launch cron jobs " and press save .  
10.Go to Home \>\> Admin Tools \>\> Scheduled jobs  
11.Click the link below " URL to check and launch qualified cron jobs: " to test the cron job .  
12.If it works it will as like below :`cron_run_jobs.php cronjobid: 2 priority=10 entity=1 label=SendEmailsReminders - qualified - result of run_jobs = 1 - reprogrammed cron_run_jobs.php cronjobid: 4 priority=50 entity=0 label=PurgeDeleteTemporaryFilesShort -> we change entity so we reload user and conf - not qualified cron_run_jobs.php cronjobid: 1 priority=50 entity=1 label=SendReminderForExpiredSubscriptionTitle - not qualified cron_run_jobs.php cronjobid: 3 priority=50 entity=1 label=RecurringInvoices - not qualified cron_run_jobs.php cronjobid: 5 priority=90 entity=0 label=MakeLocalDatabaseDumpShort -> we change entity so we reload user and conf - not qualified Result: 5 jobs - 1 launched = 1 OK + 0 KO`  
13.Test cron job command in your host .( If in windows you could use cmd and type as below to test : { D:\Xampp\php\php.exe D:\Xampp\htdocs\cron\_run\_jobs.php your\_Security\_key your\_admin\_name cronid } . If you use linux system , just use terminal to excute like { php cron\_run\_jobs.php your\_Security\_key your\_admin\_name cronid } .)  
14.Add the cron job command to your Scheduled Task tools in windows .  
In linux ,you will need to add command line in the end of Scheduled jobs page " \*/5 \* \* \* \* pathtoscript/scripts/cron/cron\_run\_jobs.php xzR787r1izJOtgRibPW9I87tIF5Iq6L5 admin \> /var/lib/dolibarr/documents/cron\_run\_jobs.php.log " into your contab .

---

<div class="post-metadata">

**Author:** ![sac](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/sac/32/3790_2.png) [@sac](https://www.dolibarr.org/forum/u/sac)\
**Post date:** [January 5, 2021, 2:18pm UTC](https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982/4 "2021-01-05T14:18:10Z")

</div>

It’s not working. I gave up after trying for a long time.  
As of now I am using a tool, **SQLBackupAndFTP** for taking SQL dumps regularly (along with folder backup for docs).  
It is a great free solution for anyone looking to set up a robust automated backup plan.  
It even sends email in case of backup failure.  
I felt this to be superior to the inbuilt scheduled backup of Dolibarr.

---

<div class="post-metadata">

**Author:** ![sac](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/sac/32/3790_2.png) [@sac](https://www.dolibarr.org/forum/u/sac)\
**Post date:** [January 5, 2021, 7:20pm UTC](https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982/5 "2021-01-05T19:20:56Z")

</div>

I get this error,  
\*\*\*\*\* cron\_run\_jobs.php (12.0.4) pid=10940 \*\*\*\*\* userlogin=admin \*\*\*\*\* 2021-01-05T22:18:18Z \*\*\*\*\*  
cron\_run\_jobs.php cronjobid: 2 priority=50 entity=0 label=PurgeDeleteTemporaryFilesShort - not qualified

---

<div class="post-metadata">

**Author:** ![trekmorris](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/t/dfb087/32.png) [@trekmorris](https://www.dolibarr.org/forum/u/trekmorris)\
**Post date:** [January 6, 2021, 12:36am UTC](https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982/6 "2021-01-06T00:36:01Z")

</div>

Hi Sac

What is your command line looks like ??  
Like as below ?  
…/scripts/cron/cron\_run\_jobs.php 0l6izKXDrxM3Id5M24bG29uGZm56yXzT admin [cronjobid]

---

<div class="post-metadata">

**Author:** ![sac](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/sac/32/3790_2.png) [@sac](https://www.dolibarr.org/forum/u/sac)\
**Post date:** [January 6, 2021, 4:34am UTC](https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982/7 "2021-01-06T04:34:19Z")

</div>

…/scripts/cron/cron\_run\_jobs.php 9VE852BdChlCi2xyT2Vvi7dTLFYrs541 admin [cronjobid]

---

<div class="post-metadata">

**Author:** ![trekmorris](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/t/dfb087/32.png) [@trekmorris](https://www.dolibarr.org/forum/u/trekmorris)\
**Post date:** [January 7, 2021, 1:14pm UTC](https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982/8 "2021-01-07T13:14:04Z")

</div>

Hi Sac

I have tried to do the procedure again in windows system.  
But i cound not find the way to fix it .  
Maybe we will need to wait someone to test it .

---

<div class="post-metadata">

**Author:** ![sac](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/sac/32/3790_2.png) [@sac](https://www.dolibarr.org/forum/u/sac)\
**Post date:** [January 7, 2021, 10:02pm UTC](https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982/9 "2021-01-07T22:02:37Z")

</div>

@trekmorris I hope so.  
@ksar Could you please look into this? Is this functioning for you in 12.0.4?

---

<div class="post-metadata">

**Author:** ![trekmorris](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/t/dfb087/32.png) [@trekmorris](https://www.dolibarr.org/forum/u/trekmorris)\
**Post date:** [January 8, 2021, 8:24am UTC](https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982/10 "2021-01-08T08:24:08Z")

</div>

Hi sac

I may find the problem is .  
Please go to Admin tools \>\> about Dolibarr .  
And check the " TimeZone PHP (server) " is same as your server .  
If not , please open the php.ini file and search " date.timezone " to correct it .  
Then go to Scheduled jobs page and change " Local database backup " setting to execute this  
job per 10 mins to test .

---

<div class="post-metadata">

**Author:** ![sac](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/sac/32/3790_2.png) [@sac](https://www.dolibarr.org/forum/u/sac)\
**Post date:** [January 8, 2021, 9:22am UTC](https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982/11 "2021-01-08T09:22:04Z")

</div>

The zone is same in both places.

---

<div class="post-metadata">

**Author:** ![trekmorris](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/t/dfb087/32.png) [@trekmorris](https://www.dolibarr.org/forum/u/trekmorris)\
**Post date:** [January 8, 2021, 4:05pm UTC](https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982/12 "2021-01-08T16:05:33Z")

</div>

Hi sac

As my testing , if i click the cron job testing url and get error "not qualified " is normal .  
That because you have enabled the cron job in dolibarr , but the windows schedule task tool has not executed the cron\_run\_jobs.php yet .  
If you look at the task tool history , and that command works every 5 mins , then you could go back to see the backup page to see if dolibarr get new backup or not . (Note. Please set local database backup job execute per 10 mins to test .) And because it need to wait for windows task tool to execute cron\_run\_job.php , so it maybe would delay for 3 or 4 mins to get new backup file .

---

<div class="post-metadata">

**Author:** ![valentindu23](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/v/e19b73/32.png) [@valentindu23](https://www.dolibarr.org/forum/u/valentindu23)\
**Post date:** [June 16, 2021, 1:00pm UTC](https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982/13 "2021-06-16T13:00:28Z")

</div>

> [@sac](#):
>
> It’s not working. I gave up after trying for a long time.  
> As of now I am using a tool, **SQLBackupAndFTP** [Garde Meubles Paris](https://www.garde-meuble.com/) for taking SQL dumps regularly (along with folder backup for docs).  
> It is a great free solution for anyone looking to set up a robust automated backup plan.  
> It even sends email in case of backup failure.  
> I felt this to be superior to the inbuilt scheduled backup of Dolibarr.

Thank you for these explanations. It helps us a lot.

---

<div class="post-metadata">

**Author:** ![trekmorris](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/t/dfb087/32.png) [@trekmorris](https://www.dolibarr.org/forum/u/trekmorris)\
**Post date:** [September 22, 2025, 2:44pm UTC](https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982/14 "2025-09-22T14:44:20Z")

</div>

Update :

When you follow the step 11 or step 13 to test cron job , and it show out some messsage like below :

TZ server = UTC - set in PHP ini /etc/php/8.2/cli/php.ini  
cron\_run\_jobs.php search qualified job using filter: {“t.rowid”:“5”}  
cron\_run\_jobs.php cronjobid: 5 priority=90 entity=0 label=MakeLocalDatabaseDumpShort - not qualified (datenextrunok=0, datestartok=1, dateendok=1)  
\*\*\*\*\* cron\_run\_jobs.php end - 2025-09-21T15:00:21Z - MX23 \*\*\*\*\*

You will need to check " date.timezone" in " CLI php.ini " same as "FPM php.ini " .
