$ cat greponofflog if [ -f /home/gim/onoff.log ]; then cp /home/gim/onoff.log /home/gim/_onoff.log fi grep -h -e 'Stopping ACPI' -e 'Started User Manager for UID 1000' /var/log/syslog /var/log/syslog.[0-9] >> /home/gim/_onoff.log sort -u /home/gim/_onoff.log > /home/gim/onoff.log