Skip to content
Snippets Groups Projects
Commit e194f37a authored by birk's avatar birk
Browse files

added player check via cronjob

parent fa742773
Branches
No related tags found
No related merge requests found
......@@ -17,6 +17,12 @@ sudo apt-get install unattended-upgrades
setxkbmap ch
```
Enable automtic security update.
```bash
sudo dpkg-reconfigure unattended-upgrades
```
Install necessary software.
```bash
......@@ -69,4 +75,17 @@ This ensures that the player software starts automatically after startup and pos
Create directory `~/.config/systemd/user` and copy `service/player.service` there.
Enable the service: `systemctl --user enable player.service`
Reload the daemon: `sudo systemctl daemon-reload`
And restart the service: `sudo systemctl restart player.service`
\ No newline at end of file
And restart the service: `sudo systemctl restart player.service`
## Defining cronjobs to supervise the player and to delete the log file weekly
Via `crontab -e` add:
```bash
SHELL=/bin/bash
USER=itz
* * * * * /home/itz/madek-broadcaster/service/service_check.sh
0 0 * * 1 rm /home/itz/log
```
#!/bin/sh
age=$(stat -c %Y ~/player_log/last_media_entry.txt)
now=$(date +"%s")
age=$((now - age))
if [ "$age" -gt 300 ]; then
/home/itz/madek-broadcaster/service/service_restart.sh
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment