Nextcloud backgroundJob not running


I have some problem with cronjobs

I created a Cron class inside my lib
Apps/myApp/lib/BackgroundJob/MyCronClass which extends ( OC\BackgroundJob\TimedJob) and set this in my info.xml like below

OCA\MyApp\BackgroundJob\MyCronClass I also set crontab in ubuntu * * * * * cd /var/www/html /usr/bin/php - cron.php

Grep CRON /var/log/syslog tell me that cron is running under root and is ok

For test I put mkdr(’data/testfolder’) at the start of cron.php and every one Minutes it create a testfolder in my data folder

But content of Run method in MyCronClass not executed !!!

here is my class

namespace OCA\MyApp\BackgroundJob;

use OC\BackgroundJob\TimedJob;
use OCA\MyTableMapper;

class MyCronClass extends TimedJob
    private $mapper;

    public function __construct(MyTableMapper $MyTableMapper)
        $this->mapper = $MyTableMapper;

    protected function run($args)


Cron needs to be run as www-data to work not root.

Anything in your logs?