Hallo Experts,
I would dearly love some suggestions on how to accomplish this. I need to create a log file of last logins. I have found the 'last' command to have enough information for my needs. The problem is that the output of this command seems to get overwritten, i.e. it only contains the last week or so. My idea was to have cron output the details of 'last' to a file, say every three days. The problem I have is that if I do this (for ex. 0 0 * * 1,3,6 /usr/bin/last >>/file/to/append/to ) there will be duplicate entries. Is there any way to avoid this with a script (perhaps using 'diff'), or a neater, simpler solution?
Many thanks for any input.
I would dearly love some suggestions on how to accomplish this. I need to create a log file of last logins. I have found the 'last' command to have enough information for my needs. The problem is that the output of this command seems to get overwritten, i.e. it only contains the last week or so. My idea was to have cron output the details of 'last' to a file, say every three days. The problem I have is that if I do this (for ex. 0 0 * * 1,3,6 /usr/bin/last >>/file/to/append/to ) there will be duplicate entries. Is there any way to avoid this with a script (perhaps using 'diff'), or a neater, simpler solution?
Many thanks for any input.