Read the statement by Michael Teeuw here.
How to autorestart MM once a day
-
Hi, I was trying to autorestart the mirror once a day. The problem is my twitter feed that stacks every 1-2 days. I was not able to fix it, only restart helps. I’ve added the cronjob (?) line, however, it doesn’t work for me.
Can some one point me in to the right direction, how to do the auto restart with other options? PM2 or other?
I need step by step, please. -
@MaxPower It stacks every 1-2 days? I don’t quite understand what that means.
In any case, what command are you using to restart? Are you trying to restart MM (recommended) or the RPi? If you have
pm2
installed and managing your MM process, I suggest usingpm2 restart mm
. Whatever commend you choose, run it in Terminal first to ensure it will do what you intend.There are lots of videos and walkthroughs available online on how to use
crontab
.I recommend you then add the following
crontab
task:* 4 * * * pm2 restart mm
This will restart MM every day at 4am (when I assume you’re not using it) so that it’s ready in the morning.
-
@ninjabreadman thank you for the help!
Sorry, I meant that my twitter modul stucks every day or so. I’m not sure why, but every other say one twit stuck and stays there forever until I restart MM. Sometimes it can be after 2-3 days sometimes several hours. So the esiest way I found is to restart the mirror every day.
Thanks for the script, I added it to the cron, I hope it will work. -
@MaxPower Sound like it would be better to file an issue with the module developer github, to fix the problem, rather than have to restart you pi.
-
@MaxPower said in How to autorestart MM once a day:
I recommend you then add the following crontab task:
* 4 * * * pm2 restart mm
Sorry to bump this old topic, but I found this searching for how to restart MM automatically and the crontab line given isn’t quite correct. That line will restart MM every minute from 4am to 5am. The line to get it to run just once is something like:
17 4 * * * pm2 restart mm
That’ll run at 4:17 am only.
-
@DaveChild also need to run the cron task under the user id that created the pm2 task… usually pi
running under root (default) will fail