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

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 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

1 Like

Dear Kev,

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

Many thanks,-
Peter

1 Like

Did you try

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

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

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

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.

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"

Hi Peter

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

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

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.

2 Likes

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.

1 Like

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