[backport] [stable6] Skip filescan but execute hooks

Backport of #8607
Merge pull request #8850 from owncloud/stable6_backport_8607

[backport] [stable6] Skip filescan but execute hooks