# Running automatic actions using "daily background job for tasks" event name

**URL:** <https://kanboard.discourse.group/t/running-automatic-actions-using-daily-background-job-for-tasks-event-name/1752>\
**Category:** Questions\
**Created:** [April 7, 2021, 11:10am UTC](https://kanboard.discourse.group/t/running-automatic-actions-using-daily-background-job-for-tasks-event-name/1752 "2021-04-07T11:10:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grimroper](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@Grimroper](https://kanboard.discourse.group/u/Grimroper)\
**Post date:** [April 7, 2021, 11:10am UTC](https://kanboard.discourse.group/t/running-automatic-actions-using-daily-background-job-for-tasks-event-name/1752/1 "2021-04-07T11:10:08Z")

</div>

Hi everyone, I wonder if someone can help me.

Ive been using Kanbaord for a few years now and I really like it, though this is my first post in this forum!

Just recently I’ve been looking in to automatic actions to help manage the growing number of tasks but I’m having trouble understanding how I get those actions which use the daily background job for task to complete.

For example I have an automatic action to close a task if there is no activity on it after a number of days once its in a particular column. In my case that column is called “DONE” I want any task moved into “DONE” to stay there for X days before being closed automatically.

Reading the [documentation](https://docs.kanboard.org/en/latest/admin_guide/cronjob.html) I believe I need to create a CRON job to trigger the “Daily background job for tasks” event name.

Ive followed that documentation and set up a CRON job in my Website Control Panel. Which looks like this

`0 0 * * * cd /path/to/kanboard && ./cli cronjob`

That runs as expected from a time point of view but doesn’t trigger anything in my Kanboard. Instead I get an email confirming “This script run only from the command line”

Ive asked my ISS about this. They said I need to change to CRON job command to the following

`0 0 * * * php -q /path/to/kanboard && ./cli cronjob`

When I do that again nothing happens on the Kanboard though the email get this time says “No input file specified” which seems a bit more promising.

I will hold my hand up here and say I know nothing about CRON jobs, this is all new to me.

My guess from the above is the entry I have created is a trigger that runs a specific job at the pre-set time, in my case once a day at midnight.

Assuming that’s correct then my problem seems to be though the trigger is working, the job I’m trying to run, i.e. the CRON job referred to in the above documents, is either:-

- not in the location Im looking for it or
- isnt there because I still need to create it or
- my command isn’t correct in someway.

I’m hoping someone here can point me int he right direction. I don’t think I’m far away from getting this working but so far I havent been able to find the final piece of the puzzle.

Many thanks  
Kev

---

<div class="post-metadata">

**Author:** ![pfabri](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@pfabri](https://kanboard.discourse.group/u/pfabri)\
**Post date:** [November 17, 2022, 6:43pm UTC](https://kanboard.discourse.group/t/running-automatic-actions-using-daily-background-job-for-tasks-event-name/1752/2 "2022-11-17T18:43:24Z")

</div>

Dear Kev,

I’m facing the exact same problem. Have you been able to find a solution to this?

Many thanks,-  
Peter

---

<div class="post-metadata">

**Author:** ![alfredb](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/alfredb/32/1051_2.png) [@alfredb](https://kanboard.discourse.group/u/alfredb)\
**Post date:** [November 17, 2022, 7:16pm UTC](https://kanboard.discourse.group/t/running-automatic-actions-using-daily-background-job-for-tasks-event-name/1752/3 "2022-11-17T19:16:54Z")

</div>

Did you try

> 0 0 \* \* \* php /path/to/kanboard/cli cronjob

---

<div class="post-metadata">

**Author:** ![creecros](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/creecros/32/156_2.png) [@creecros](https://kanboard.discourse.group/u/creecros)\
**Post date:** [November 17, 2022, 7:28pm UTC](https://kanboard.discourse.group/t/running-automatic-actions-using-daily-background-job-for-tasks-event-name/1752/4 "2022-11-17T19:28:41Z")

</div>

Here is the crontab that comes in the docker version, not sure it helps you but it works:

> <https://github.com/kanboard/kanboard/blob/main/docker/etc/crontabs/nginx>

its also the example given in the docs.

You could also test your cron job by manually triggering it using:  
`https://domain.tld/cronjob?token=WEBHOOK_TOKEN_HERE`

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [November 17, 2022, 9:17pm UTC](https://kanboard.discourse.group/t/running-automatic-actions-using-daily-background-job-for-tasks-event-name/1752/5 "2022-11-17T21:17:38Z")

</div>

I used the below 3 for the last few years across different shared/nonshared vps… currently, without checking in the server, I use the middle one as Im not on cPanel anymore.

Either way, hope one of the commands from all the rpelies work for you as automatic actions is everything to get things done in a kanban style workflow.

```auto
on 'domain' as 'user'
*/5 * * * * /usr/local/bin/php -f /home/domainfolder/public_html/cron.php

USE THIS
cd /home/domainfolder/public_html/ && ./cli cronjob >/dev/null 2>&1

FROM CPANEL - WORKS
0 7 * * * /usr/bin/curl "https://domain.com/cronjob?token=1ef30a21b3651e17bmytokenXXXXX73b975ba404964a6950abfa8d6ad"

```

---

<div class="post-metadata">

**Author:** ![Grimroper](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@Grimroper](https://kanboard.discourse.group/u/Grimroper)\
**Post date:** [November 19, 2022, 3:33pm UTC](https://kanboard.discourse.group/t/running-automatic-actions-using-daily-background-job-for-tasks-event-name/1752/6 "2022-11-19T15:33:57Z")

</div>

Hi Peter

I did eventually get there. Im currently using the below to run the jobs at midnight in CPanel

```auto
0	0	*	*	*	/usr/local/bin/php /home/*your_domain_name*/public_html/cli cronjob >/dev/null 2>&1

```

---

<div class="post-metadata">

**Author:** ![pfabri](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@pfabri](https://kanboard.discourse.group/u/pfabri)\
**Post date:** [November 22, 2022, 6:10pm UTC](https://kanboard.discourse.group/t/running-automatic-actions-using-daily-background-job-for-tasks-event-name/1752/7 "2022-11-22T18:10:35Z")

</div>

Thank you to everybody for the very helpful and attentive responses. The solution, which worked in the end was the one provided by @Grimroper. The location of php has to be explicitly provided in order to execute it as a cli command. Without this explicit location the default php gets triggered, which I believe is the one to tailor cgi requests. But I don’t really speak PHP neither do I know how it all works. But I hope it makes some sense at least.

---

<div class="post-metadata">

**Author:** ![pfabri](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@pfabri](https://kanboard.discourse.group/u/pfabri)\
**Post date:** [November 22, 2022, 6:11pm UTC](https://kanboard.discourse.group/t/running-automatic-actions-using-daily-background-job-for-tasks-event-name/1752/8 "2022-11-22T18:11:39Z")

</div>

Thank you, this worked. Although, initially I also had to change the permission of the ‘cli’ file to 755. Oddly, though, when I changed it back to 744 later one it kept on working.

---

<div class="post-metadata">

**Author:** ![ianme](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/ianme/32/710_2.png) [@ianme](https://kanboard.discourse.group/u/ianme)\
**Post date:** [September 27, 2023, 11:09am UTC](https://kanboard.discourse.group/t/running-automatic-actions-using-daily-background-job-for-tasks-event-name/1752/9 "2023-09-27T11:09:17Z")

</div>

I had the same problem, the solution proposed by @Grimroper solved it with a minor change: there is no public\_html directory in v.1.2.32, for me this works:

`/usr/local/bin/php /home/*path-to-kanboard*/cli cronjob >/dev/null 2>&1`

instead of  
`/usr/local/bin/php /home/*path-to-kanboard*/public_html/cli cronjob >/dev/null 2>&1`
