I need to restart one of my services regularly, I tried to to put this into my crontab:
0 0 * * * systemctl --user restart bot
I found that it doesn't work, after a few days when I check the status of the service, the uptime of it is over 2 days. If I run the same command manually it works, i use the root user BTW, it's VPS with nothing important on it.
Why wouldn't this work? what could be the issue here?
If I check /var/log/syslog this is the only line that's related to this particular job:
Aug 30 08:09:01 ubuntu CRON: (root) CMD (systemctl --user restart bot &>/var/log/bot.log)
I edited the schedule a dozen times to let it run the next minute to see if it works. Lines above and below this are about other jobs which work without any problems.