How to execute a script on startup

Im writing a prety simple script which records the user by which, and time at which it is executed into a log file. I was wishing to make this script execute each time someone logs into my computer so that I can keep a log of this. However I cant seem to find anything to do this. I was wishing for something like the .bashrc to exist, but instead of terminal, running when someone logged into the machine, also tried the kde startup scripts by adding mine but it doesnt seem to work. Can anyone help?

Maybe I’m missing something, but are you just trying to figure out when people log into the computer? If so then the last command is going to be your friend.

last command isn’t enough?

Please edit your post title accordingly:

1 Like

thanks to both who suggested last, I didnt know about that one