mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Add a CLI script for manually triggering checking a folder for updates
This commit is contained in:
parent
aaecfa18ed
commit
909d279e55
1 changed files with 22 additions and 0 deletions
22
apps/files/triggerupdate.php
Normal file
22
apps/files/triggerupdate.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
require_once __DIR__ . '/../../lib/base.php';
|
||||
|
||||
if (OC::$CLI) {
|
||||
if (count($argv) === 2) {
|
||||
$file = $argv[1];
|
||||
list(, $user) = explode('/', $file);
|
||||
OC_Util::setupFS($user);
|
||||
$view = new \OC\Files\View('');
|
||||
/**
|
||||
* @var \OC\Files\Storage\Storage $storage
|
||||
*/
|
||||
list($storage, $internalPath) = $view->resolvePath($file);
|
||||
$watcher = $storage->getWatcher($internalPath);
|
||||
$watcher->checkUpdate($internalPath);
|
||||
} else {
|
||||
echo "Usage: php triggerupdate.php /path/to/file\n";
|
||||
}
|
||||
} else {
|
||||
echo "This script can be run from the command line only\n";
|
||||
}
|
||||
Loading…
Reference in a new issue