diff --git a/apps/files/lib/BackgroundJob/ScanFiles.php b/apps/files/lib/BackgroundJob/ScanFiles.php
index cb2b9d4b1c9fab74089667469766ff28ff269fa4..04ba8524131124d8048914e93adb3a0f27929a85 100644
--- a/apps/files/lib/BackgroundJob/ScanFiles.php
+++ b/apps/files/lib/BackgroundJob/ScanFiles.php
@@ -97,6 +97,10 @@ class ScanFiles extends \OC\BackgroundJob\TimedJob {
 	 * @throws \Exception
 	 */
 	protected function run($argument) {
+		if ($this->config->getSystemValueBool('files_no_background_scan', false)) {
+			return;
+		}
+		
 		$offset = $this->config->getAppValue('files', 'cronjob_scan_files', 0);
 		$users = $this->userManager->search('', self::USERS_PER_SESSION, $offset);
 		if (!count($users)) {