Quantcast
Channel: Squeezebox : Community : Forums - Logitech Media Server
Viewing all articles
Browse latest Browse all 5300

Squeezelite players on debian linux Fixed crashing errors. here is my script.

$
0
0
I have been doing alot of work with Squeezelite and LMS on debian based linux boxes. One of the sbcs we used was the Raspberry PI model B 512mb version.
Anyone who has tried this probably found it less than satisfactory, for us, the LMS/player combo would crash like clockwork, every 4-6 hours. After weeks of tracking down the errors in the log, i found no help online.

So i wrote this script, which auto rotates the LMS logs, and have not had any further crashes.



Quote:

#LogitechMediaServer auto log cleaning.
#this script should be made to run via crontab at least once a day
#justinhalek@gmail.com
# Define a date var
Date=$(date +%F)

#Make me some backups please
cp /var/log/squeezeboxserver/server.log /var/log/squeezeboxserver/serverlog_$Date.log.backup
cp /var/log/squeezeboxserver/scanner.log /var/log/squeezeboxserver/scanner_$Date.logbackup

# clean out the logs, this is what actuall deletes the log files
rm -rf /var/log/squeezeboxserver/server.log
rm -rf /var/log/squeezeboxserver/scanner.log

# lets delete some old files here.... anything older than 1 day goes to file heaven.
find /var/log/squeezeboxserver/serverlog_* -mtime +1 -exec rm {} \;
find /var/log/squeezeboxserver/scanner_* -mtime +1 -exec rm {} \;

#Move to the right dir so we can make some files
cd /var/log/squeezeboxserver

#Print some text to to brand new empy log files.
printf 'Hello World \nThis log is auto cleaned!' > server.log
printf 'I like clean logs :D' > scanner.log


#let me know we are done!
echo "Logs cleaned"
#All done. Lets get out of here!
exit
I Just wanted to be sure this was not causing me any problems that I haven't noticed yet.

thanks for taking a look!

Viewing all articles
Browse latest Browse all 5300

Trending Articles