@@ -184,6 +184,39 @@ Manage the background scanner
184184The background scanner does not require any manual intervention.
185185However at times you might want to inspect it or perform tasks on it.
186186
187+ How the background scanner works
188+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
189+
190+ Each time the background scanner runs, it processes files in three passes (in priority order),
191+ up to the configured batch size per run:
192+
193+ 1. **Unscanned files ** — files that have never been scanned, including files that were
194+ uploaded or existed before the Antivirus app was installed. All such files will
195+ eventually be scanned as the background job runs repeatedly.
196+
197+ 2. **Modified files ** — files whose modification time is newer than their last scan time,
198+ i.e. files that have been updated since they were last scanned.
199+
200+ 3. **Outdated files ** — files that were last scanned more than 28 days ago (configurable
201+ via ``av_rescan_days ``), to account for updated virus definitions.
202+
203+ The scanner runs at most once every 15 minutes by default. The effective
204+ frequency is also bounded by how often Nextcloud's background job mechanism
205+ (cron, webcron, or ajax) runs.
206+
207+ To change the minimum interval between runs (in seconds)::
208+
209+ sudo -E -u www-data php occ config:app:set files_antivirus av_scan_interval --value="900"
210+
211+ To change the number of days before already-scanned files are rescanned::
212+
213+ sudo -E -u www-data php occ config:app:set files_antivirus av_rescan_days --value="28"
214+
215+ **External storage: ** files on external storage are included in passes 1 and 2
216+ (initial scan and rescan on modification). However, the periodic 28-day rescan
217+ (pass 3) applies only to files under ``files/ `` (i.e. home storage), not external storage.
218+
219+
187220Get info about files in the scan queue
188221~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
189222
0 commit comments