Hi,
I've got a problem with logs, so I wrote a script to modify syslog files but after script is done logs not working, they are freezed and nothing is written to them. This happend when I modify "syslog" file. However I notice that when I was using this script for only "syslog.2" and "syslog.1" without "syslog", everything was fine; the logs were working and the lines with error was deleted. So maybe someone can help me find out how to make logs work after script is done or maybe someone know where is the problem.
Maybe someone know how log works in unraid, how they are created, how they are splitted, what is the max size of syslog etc. and could explain it to me.
I've checked permission after modification and change it to exactly how they was before modify but it not work and logs were still freezed.
This is my script. I know it's kinda stupid but it might work for me.
#!/bin/bash
cd /var/log/
grep -v "input irq status" syslog.5 syslog.4 syslog.3 syslog.2 syslog.1 syslog >> tempfile
diff <(tail -n 15 syslog) <(tail -n 15 tempfile) 1>/dev/null
if [[ $? == "0" ]]
then
echo "The same"
rm syslog.*
else
echo "Not the same"
fi
diff <(tail -n 15 syslog) <(tail -n 15 tempfile)
if [[ $? == "0" ]]
then
echo "The same"
mv tempfile syslog
rm tempfile
else
echo "Not the same"
fi
echo "Done"