Mon petit Raspberry PI 3 commence à avoir pas mal de fonctionnalité, et à certain moment je constate qu’il part dans les choux, ou les carottes (je vous laisse choisir). Pour éviter cela, j’ai programmé un redémarrage tous les mercredi à 0:30 du matin.
Voici le détail de ce que j’ai fait, ceci est fonctionnel est en place.
Programmer un redémarrage tous les mercredi à 00:30
Depuis un terminal sur votre Raspberry :
Le redémarrage
crontab -e (pas de sudo !)
Choisissez l’editeur (nano, pico, ee…), et ajoutez les lignes suivantes à la fin :
Explications :
- 0=> 59
- 0=23
- 1=>31
- 1=>12
- Dimanche = 0
- Lundi = 1
- Mardi = 2
- Mercredi = 3
- Jeudi = 4
- Vendredi = 5
- Samedi = 6
- Dimanche = 7
Ensuite la commande à effectuer
sudo service domoticz.sh restart
Bonus, petit schémas plus parlant fournis par Wikipedia :
# ┌───────────── minute (0 - 59) # │ ┌───────────── hour (0 - 23) # │ │ ┌───────────── day of the month (1 - 31) # │ │ │ ┌───────────── month (1 - 12) # │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday; # │ │ │ │ │ 7 is also Sunday on some systems) # │ │ │ │ │ # │ │ │ │ │ # * * * * * command to execute
La deuxième ligne sert à debug, vous pouvez la de-commenter si besoin, elle écrira dans un fichier /home/pi/restart_domoticz.log la valeur : Domoticz restart $(date)
Pour le consulter :
cat /home/pi/restart_domoticz.log
Vous pourrez trouver ceci dans le fichier :
Domoticz restart Wed 1 Jan 00:30:01 CET 2020
Activer les log
Consulter les log
Jan 1 00:30:01 raspberrypi CRON[32497]: (pi) CMD (sudo service domoticz.sh restart)