Library update as a cronjob

Hello,
sorry if this topic has already been covered here, but unfortunately I couldn’t find anything in the search.
I have a Volumio primo to which a NAS drive with several 100 GB of music data (flac and mp3) is connected as a source.
The source changes continuously as I rip and add new CDs.
I don’t want to keep updating the library manually, is there a way to set this up as a nightly cronjob? I have SSH access; is it possible to start the update via command line?
Thanks a lot!
mibant

See;

Thanks for the fast reply!
Seems to work, exactly what I was looking for! (and could not find :roll_eyes:)

Be aware of the downside.

If a library update is running and you shut down the system, you might loose all data or cripple MPD.

Thank you, I have read that. But I don’t expect any problems with it during a night-time scan, because there would have to be a power failure.

Sorry, additional question: ist there any log, which tracks these updates, or can it be enabled?
Apparently neither mpd.log nor another log I can see in /var/log are used. If in doubt, you should be able to see the status there.

the only thing I can think of is monitoring the pid:

volumio@volumio-allo:~$ ps aux | grep "mpc update"
volumio  10123  0.0  0.0   1984   436 pts/0    S+   14:10   0:00 mpc update --wait NAS/
volumio@volumio-allo:~$ pidof mpc update
10123

That’s right, that should also be enough. Thanks for your patience!