Oke, solved it by making a Crontab!
Maybe it is usefull for somebody else to know how:
- Login by ssh into pi:
login: root
password: rune
- Enable cron:
- Code: Select all
systemctl enable cronie
- Code: Select all
systemctl start cronie
- Use Nano to edit crontab:
- Code: Select all
sudo EDITOR=nano crontab -e -u root
and then add the following lines:
- Code: Select all
30 23 * * 1-5 /sbin/shutdown -h now
- Code: Select all
30 10 * * 0,6 /sbin/shutdown -h now
this would shutdown the Pi at 23:30 from Monday to Friday and on 10:30 on Saturday and Sunday.
The structure is very simple:
1. The number of minutes after the hour (0 to 59)
2. The hour in military time (24 hour) format (0 to 23)
3. The day of the month (1 to 31)
4. The month (1 to 12)
5. The day of the week(0 or 7 is Sun, or use name)
6. The command to run
More graphically they would look like this:
* * * * * Command to be executed
- - - - -
| | | | |
| | | | +----- Day of week (0-7)
| | | +------- Month (1 - 12)
| | +--------- Day of month (1 - 31)
| +----------- Hour (0 - 23)
+------------- Min (0 - 59)
Have fun!