Commit Graph

91 Commits (stable20)

Author SHA1 Message Date
Louis Chemineau 0f713ee278 Output exception in cron
Signed-off-by: Louis Chemineau <louis@chmn.me>
3 years ago
hoellen 6e3513aa89 Remove posix_getpwuid and compare only userid
Signed-off-by: hoellen <dev@hoellen.eu>
4 years ago
Christoph Wurst cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Michael Kuhn ab6a18f420 cron: Adapt to 5 minutes recommendation
Update the comment to make clear that we ask for 14 minutes worth of
jobs on purpose so at most three parallel cron jobs are running.

Signed-off-by: Michael Kuhn <michael@ikkoku.de>
4 years ago
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Daniel Kesselberg f25e2d82a5
Make the warning about wrong permissions more clear.
It's basically the same as for console.php now.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
5 years ago
Joas Schilling 0c77cd21f9
Make sure maintenance mode is always casted to bool
Signed-off-by: Joas Schilling <coding@schilljs.com>
5 years ago
Joas Schilling 7860c81523
Fix code style
Signed-off-by: Joas Schilling <coding@schilljs.com>
6 years ago
Morris Jobke dd34cb7540
Less deprecated calls to OCP\Util::writeLog
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Morris Jobke 9ef6148bfa
Deprecated OCP interface to fetch background job type
* was not used by apps and also is not needed
* migrated the documentation to IJobList

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Morris Jobke e70edb33db
Log full exception in cron instead of only the message
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Roeland Jago Douma b8af7ee9bc
Nextcloud 13 is not compatible with newer than php 7.2
Just to avoid users from trying this with a to new (untested) php version

* Moved the check logic to 1 place
* All directly callable scripts just require this on top
* exit hard (-1) so we know scripts won't continue
* Return status 500 so no sync clients will try fancy stuff

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
7 years ago
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Morris Jobke 1c38a83927 Always log cron execution
There was a setting to disable the last execution of cron. There is no known
problem with this write access and it was also questioned when this feature
was build in https://github.com/owncloud/core/pull/7689#issuecomment-38264707

Recently there was also a bug report about a non-visible last cron execution
(#6088) - let's better remove this.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Noveen Sachdeva 1b1f403a5d
Add duration of last job execution to the table 7 years ago
Ko- 0024b67aaf Check that set_time_limit is not disabled before calling it
Signed-off-by: Ko- <k.stoffelen@cs.ru.nl>
7 years ago
Artem Sidorenko 4541240da2 Exit with error code if posix ext missing or wrong user
similar to the console.php
7 years ago
Morris Jobke 9533f4e5ed
Clean up single user mode
Single user mode basically disables WebDAV, OCS and cron execution. Since
we heavily rely on WebDAV and OCS also in the web UI it's basically useless.
An admin only sees a broken interface and can't even change any settings nor
sees any files. Also sharing is not possible.

As this is at least the case since Nextcloud 9 and we haven't received any
reports for this it seems that this feature is not used at all so I removed it.

The encryption commands now rely on the well tested maintenance mode.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Roeland Jago Douma 1741fe0310
Also check in cron for old php version
Fixes #2756

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
8 years ago
Vincent Petry 5eb01b01a9
[master] Tear down FS between cron jobs (#26223)
Because some cron jobs do not always properly clean up their FS usage
and others might not clean up before setting up the FS, this could
cause potential side effects.

To make sure we exclude side effects, we tear down the FS between cron
jobs.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
8 years ago
Joas Schilling f3319f6294
Allow to call the files even when you are in another instance atm
Signed-off-by: Joas Schilling <coding@schilljs.com>
8 years ago
Jörn Friedrich Dreyer ac5788927a
log class name, ID only is hard to debug 8 years ago
Damjan Georgievski 982bdb1823 introduce NEXTCLOUD_CONFIG_DIR env variable (see #300)
nextcloud by default uses the `/config/` directory in the source/application tree for its config file(s).
with this commit that directory can be overridden by the `NEXTCLOUD_CONFIG_DIR` environment variable.

in uwsgi, you would use the option `--env "NEXTCLOUD_CONFIG_DIR=/tmp/nx-config/"`
in apache `SetENV …`
and the cli command can be run with: `NEXTCLOUD_CONFIG_DIR=/tmp/nx-config ./occ` (or just use `export` once in the
shell).

NEXTCLOUD_CONFIG_DIR can be supplied with or without the trailing slash (`/`), but in all cases `$configDir` will have
it automatically added if needed.

The other changes are several occurrences of `OC::$SERVERROOT . '/config'` to `OC::$configDir`.
8 years ago
Joas Schilling 0215b004da
Update with robin 8 years ago
Joas Schilling ba87db3fcc
Fix others 8 years ago
Morris Jobke c2d88a08b7
Remove unneeded checks if it runs on a Windows machine
* the setup check is still there
8 years ago
Lukas Reschke aba539703c
Update license headers 8 years ago
Joas Schilling 92c21fd6f4
Do not lock the cron anymore so we can have multiple workers 8 years ago
Joas Schilling d0a2fa0506
Lock jobs while executing them, to allow multiple executors to run in parallel 8 years ago
Joas Schilling e252967e83
Make sure that CLI cron doesn't run for ever, but makes use of the next spawn 8 years ago
Thomas Müller 6a6fc742dc Catch class Error on all root entrypoints 8 years ago
Joas Schilling 5238fc3f54 Do not create a loop that generates thousands of jobs 8 years ago
Thomas Müller 682821c71e Happy new year! 8 years ago
Morris Jobke 95a3b4fd24 Add debug log statement for IJobList steps in cron.php
* makes debugging easier
9 years ago
Morris Jobke f46d531a4f Replace some OC_Config calls with ILogger methods 9 years ago
Morris Jobke b945d71384 update licence headers via script 9 years ago
Phil Davis a165710e99 Minor text typos
that I noticed while looking at some code.
9 years ago
Joas Schilling 36eef2ddab Add a session wrapper to encrypt the data before storing it on disk 9 years ago
Thomas Müller d3ac73c0c9 Remove OC_Log 9 years ago
Morris Jobke 60b8aa2a83 Removed OC_BackgroundJob - reduce class overhead
* method code is now in the static public namespace (5 sloc)
9 years ago
Robin Appelman d96e9d174b block cron when in single user mode 9 years ago
Thomas Müller 5ebd3a9e89 Cron has to be executed with the correct user - fixes 13912 and others 9 years ago
Jenkins for ownCloud b585d87d9d Update license headers 9 years ago
Thomas Müller e3fd13de88 cron shall not operate in case we are in maintenance mode - fixes #14843 9 years ago
Thomas Müller b4cf6e62bf cron.php on cli has no time limitation - fixes #14481 9 years ago
Morris Jobke 06aef4e8b1 Revert "Updating license headers"
This reverts commit 6a1a4880f0.
9 years ago
Bernhard Posselt 5b506ab518 use flock instead of just checking if there is a file to prevent deadlocks when the process crashed or the unlink wasnt done
move cron.lock into top directory to prevent external storage issues

use tmp directory lock file

use new config interface

incorporate #13770

add dots
9 years ago