Launching flexget automatically

I would like flexget to run automatically every hour. I have this command in my cron jobs, but it doesn’t actually seem to run:

@hourly /usr/local/bin/flexget --cron execute

Could anyone point me in the right direction? Thanks!

Did you install cron?
Did you set the crontab via crontab -e?
What is journalctl -f saying at the top of the hour?

Hi - thanks for these suggestions! Yes, I did install cron from the OSMC store. I tried journalctl - f but it didn’t show any flexget activity. service cron status did show me that the cron task had produced an error last time it tried to run:

Jul 15 23:00:01 vero CRON[21108]: (osmc) CMD (/usr/local/bin/flexget --cron execute)
Jul 15 23:00:03 vero CRON[21101]: (CRON) info (No MTA installed, discarding output)

After a little experimentation, I think the issue may have been that I needed to set up the cron job as root using sudo crontab -e rather than crontab -e (for some reason I need to run flexget as root). I’ll need to wait a while to see whether it runs automatically now, but I think this may be the solution.

UPDATE: that wasn’t the solution, the process ran as root but produced a similar error

Hi,

/usr/local/bin/flexget --cron execute

It seems cron is doing what is supposed to, it ran on the hour. No MTA, just means their is no mail server installed; so it can’t send notifications to the user.

try temporarily updating the cronjob:

@hourly /usr/local/bin/flexget --cron execute > /home/osmc/flexget.log 2>&1

Then check the log, to see whats happening with flexget after its run.

Thanks Tom.

Thanks for this suggestion, Tom! Here’s the output:

2019-07-18 20:00 CRITICAL manager Failed to find configuration file config.yml 2019-07-18 20:00 INFO manager Tried to read from: /root, /root/.flexget, /root/.config/flexget Could not instantiate manager: No configuration file found.

I have my config file in the home directory, not root. Is there any way to specify where flexget should look for the config file in the cron job?

Hi,

Does flexget need to run as root?

If not, make sure you are running crontab for osmc rather than root; so run:

crontab -e

rather than:

sudo crontab -e

If it needs to to be run as root, I would suggest copy the conf files or directory to /root.

Thanks Tom.

I copied the config file to root, and as far as I can tell it worked! Thanks for the help!