Cronjob for mopidyctl local scan

Hi all

Mopidy is so cool and is doing a perfect job! Thank you for such a cool app!!!

I run Mopidy as a service on my debian (bookworm) server with all updates on it. When I run
sudo mopidyctl local scan
the library is getting updated perfectly, no warnings, no errors. Now I would like to do this with a cronjob. But I haven’t been lucky so far. My cronjob as root looks like this
0 18 * * * mopidyctl local scan
What am I missing or doing wrong?

Thanks for some help!

David

Hi David,

What am I missing or doing wrong?

You don’t describe any precise problem, nor share an error message :slight_smile:

Hi Matthias
Thank you for your very quick answer. My problem is, that with the cronjob the library does not get updated. And I can’t see any bad behavior. I am not good at finding and reading logs, but the following command didn’t show anything. And the general logs do not give any insight either.

sudo journalctl -u mopidy

I don’t know, which command I need, to gain a deeper look.

Thank you for the details. At this stage the problem doesn’t seem to relate to Mopidy. You should read the OS documentation on cron, and make sure you know how to configure a job, collect the output, read the logs… Maybe consider switching to SystemD timers?

Thank you Matthias! Yes, I agree, that it looks like this doesn’t relate to Mopidy. But I had to start somewhere. I never used systemd-timer, but now it is a good time to give that a try.

Try using /usr/sbin/mopidyctl. I don’t think cron knows your $PATH so won’t be able to find mopidyctl otherwise.

Thank you so much! It works like you’ve mentioned!
My crontab looks like this:

0 18 * * * /usr/sbin/mopidyctl local scan

Mopidy is so cool :smiley: