Batch job locations


#1

i read about occ and batch utilities, where are they located in case one wants to run them manually.

trying to locate jobs ran by cron.php


#2

I assume, they are in table oc_jobs in the DB.


#3

so my next question is how do i manually execute them


#4

AFAIK they are run by cron or invoked by an occ command.

But I think fiddling around with this jobs is a bad idea.


#5

if you are using Cron, you can execute manually by using this command: sudo -u www-data /usr/bin/php -f /path/to/your/owncloud/cron.php.


#6

yes , my concern how do i know which jobs i running .
when i run that command all i see is
“,“remoteAddr”:”",“user”:"–",“app”:“cron”,“method”:"–",“url”:"–",“message”:“Invalidating tokens older than 2018-09-09T08:00:02+00:00”}

want to know which jobs are running, i also expected files in trash bin to be removed


#7

Hmmm, running this command doesn’t produce any log-entry here.


#8

Log level is 1 for this activity


#9

Agree. But this is only an information, not an error.


#10

All I meant is perhaps you didn’t see it because of your log level config

Still want to know about what info that job produces


#11

ok now i see them in the log

BackgroundJob\/ExpireTrash.php(85): OCA\\Files_Trashbin\\Trashbin::deleteExpiredFiles


#12

There are some jobs that you can move into separate commands, and separate crontab entries, detailed here: https://doc.owncloud.org/server/10.0/admin_manual/configuration/server/background_jobs_configuration.html#available-background-jobs


#13

So what would crontab entry look example for
occ trashbin:expire


#14

For example:
0 * * * * sudo -u www-data /path/to/occ trashbin:expire >/dev/null 2>&1 to run it once per hour. Used: https://crontab-generator.org/


#15

thanks, is this the occ file you referring to

#!/usr/bin/env php

<?php /** * Copyright (c) 2013 Thomas Müller * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ //$argv = $_SERVER['argv']; require_once __DIR__ . '/console.php';