How can a non-root user determine which days the computer ran?
Hello :)
Is there any way a non-root user can programmatically determine which days the computer ran during, say, the last month? The information is in /var/log/messages.* but those files are root:root 640. Non of the world-readable /var/log files on the Slackware 13.0 development system can be used:
Charles |
Quote:
|
Quote:
Other possible workarounds are:
|
Quote:
1) Check the file permissions - if the user running the program can't read /var/log/messages then (i) disable that particular functionality and (ii) notify the user of how to get this functionality back (i.e. run as root/change the perms on messages). Of course, this is of no use if that functionality is essential to your program! 2) Just exit the program with an error message unless the person is root, or at least has read access to /var/log/messages. Some programs need to be run as root/an admin, and there's just no way around it. |
Can you please elaborate why 'last' doesn't have enough info?
You get the boot and down times, do you need a breakdown to seconds? Cheers, Tink |
Quote:
Last is the perfect solution. I thought it only gave info since boot having mistaken removal of utmp in rc.S for removal of wtmp :redface: |
All times are GMT -5. The time now is 04:04 AM. |