# Error on cron.php execute via crontab or command line

**URL:** <https://help.nextcloud.com/t/error-on-cron-php-execute-via-crontab-or-command-line/583>\
**Category:** ℹ️ Support\
**Created:** [June 14, 2016, 6:26pm UTC](https://help.nextcloud.com/t/error-on-cron-php-execute-via-crontab-or-command-line/583 "2016-06-14T18:26:10Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Maulwurf](https://help.nextcloud.com/letter_avatar/maulwurf/32/6_449c533f586939b6e5f246632a46421f.png) [@Maulwurf](https://help.nextcloud.com/u/Maulwurf)\
**Post date:** [June 14, 2016, 6:44pm UTC](https://help.nextcloud.com/t/error-on-cron-php-execute-via-crontab-or-command-line/583/2 "2016-06-14T18:44:58Z")

</div>

Does cron.php belong to www-data?

also,

"00 2 \* \* \* root sudo -u www-data php -f /var/www/html/owncloud/cron.php"  
should be

\*/15 \* \* \* php -f /var/www/html/owncloud/cron.php

for the user www-data.  
Try calling the crontab like this:

“sudo -u www-data crontab -e” and then paste the above line inside. I think you’re using the the wrong crontab

Greetings,  
Maulwurf

---

_[View the full topic](https://help.nextcloud.com/t/error-on-cron-php-execute-via-crontab-or-command-line/583)._
