Preview php cronjob: output needed

I succed creating/running a cronjob for the preview app, but an output to some log would be much appreciated.

Seem some discussion was initiated on GitHub some time ago, but I (shame) can’t recall it.

Ass the .occ preview command used by cronjob is php, the usual &>1 kind of output is not possible.

My only way is to journalctrl around the time my cronjob is running and check for errors:
03:30:01 nextcloud CRON[18417]: (www-data) CMD (/usr/bin/nice /usr/bin/php -f /var/www/html/occ preview:pre-generate)

A more explicit like this could be really nice:

You can add -vvv to the occ command for a more detailled output.

1 Like

Actually, i did:

`30 3 * * * /usr/bin/nice /usr/bin/php -f /var/www/html/occ preview:pre-generate -vvv > /var/log/preview.cron.log

and get:
/var/log/ -rw-r–r-- 1 www-data www-data preview.cron.log
Generating previews for /usersX/files/InstantUpload/Camera/IMGx.jpg

Witch is absolutely fine having uploaded only one new pic!

Thank for the -vvv

Why I can’t make this to work?

#I edit crontab.
crontab -e -u nginx

#added line
*/31 * * * * /usr/local/bin/php -f /home/nextcloud/public/occ preview:pre-generate -vvv > /home/nextcloud/log/preview.cron.log

touch /home/nextcloud/log/preview.cron.log
chown nginx:nginx
#permissions are rw-r–r--

File stays empty. Only time stamp changes when cron runs occ.

not sure, but i am pretty sure the prblem is here.
Check who is running the cron