How to scan with bash destination folder

I had some problems with my cloud drive now sonarr is missing most of files that are available.
I would like to make bash script that would scan based on path for example
sonarrscanpath /mnt/cloud/The Orvile

I would use something like:
$curl HOST/api/command -H 'X-Api-Key: XXX' --data-binary '{ "name": "RescanSeries" }'

I tried refreshing all folders in tasks nd left it running for hours but its not working or really really slow.

I disabled indexer and download client since sonarr is trying to redownload episodes that i already have.

p.s. It would be great if sonnar would actually check if file exist before trying to download it again.