No, you are not wrong, it is good to try to get the OP to do a little bit of searches, Was I wrong to suggest using the keywords ? " use the date and who command to create a single crontab job that appends a timestamp and a list of logged in users to a log file", and it was kind of a surprise to see the first hit was another post with almost the same question, ... the OP still needs to
try to take the information and use it to suit their need.
Maybe it is me that was wrong ?
To be honest, if it was me, I wouldn't even bother with using crontab and the 'who' command,... I use the 'last' command, and it shows all the users that have logged in and the date, and if one wanted they could have it print the output
to any path they choose:
example:
- Code: Select all
last > /home/garry/last-log.txt
Or, using 'who' :
- Code: Select all
who > /home/garry/loggedin.txt
That could be put into a crontab script,.... all the OP needs now is to just
read the manuals a little, and figure out how to put the pieces together into
something they can use.
====
Well,, maybe on this :
There are no free handouts here.
No body charges any one for the advise, or comments they make, in that
sense it is all "free handouts", nobody pays any body, we are all volunteers,
those that choose to give a answer, advice, or suggestion are free to do so,
like wise, those that don't want to give any suggestion or ideas,or answer are free to not do so. But then again , maybe I am wrong, it certainly would not be the first time I am wrong,....
Someone else might even be able to simply post a script that does exactly what the OP s looking for, but I don't think that would help the OP learn anything, beyond copy/paste a script, but in any event, if some one did that,
they are free to do so, as long as they don't try to charge the OP a fee $$$,