How often should I occ scan all my files running external storage?

Hi! I’m running Nextcloud in a docker container and I have 100% of my files added as “local” storage via the external storage app. How often should/do I need to scan all my files, if I’m accessing my files very frequently? (about once every 20min during work hours).

This is how one scan looks:

docker exec nextcloud sudo -u abc php /config/www/nextcloud/occ files:scan --all
Starting scan for user 1 out of 1 (user)
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 778     | 3142  | 00:00:38     |
+---------+-------+--------------+

Total CPU usage increases by about 0.7% units during the scan.

What are the disadvantages of scanning to often? What are the disadvantages of scanning to seldom?

Scanning of a big file universe too often could cause a problem because

  • a scan hasn’t finished before a new one is triggered.
  • the server load can increase.

Scanning of a big file universe rarely could cause a problem because

  • not all files are in the file cache which wouldn’t allow to search for it.
  • opening a folder which contains unscanned files would last longer.