Home of Devon Schreiner and Skewed Motion Media

How To Edit Another User’s Crontab

Tux The Linux PenguinEvery once in a while, a person comes upon a problem that should be so easy but it is so hard to search for and find the answer you are looking for. I ran into that today.

One of our Linux boxes here at work has lately been neglected. Almost everything of importance has been migrated from it with little care given to what happens after that. The only problem was that it had a backup script still running every day, that sent out a mildly annoying email saying that it didn’t back anything up. Today, my boss finally got tired of it.

I figured this would be easy enough, there would be a simple job set up in the cron file that I could delete and we’d be on our way. Not so simple. This cron job was set up in another specific user’s crontab that nobody had the credentials for anymore. So I set out searching.

After a lot of searching, I finally find a couple of commands that will do what I want and let me view and edit another user’s crontab. This was one of those tasks that should be easy but I didn’t know the exact syntax, so I thought I’d write a post to remind myself and any other crontab using, Linux administrators.

View another user’s crontab:

sudo crontab -l -u anotheruser

Edit another user’s crontab:

sudo crontab -e -u anotheruser

And there you have it. It’s as simple as that. What other commands have you searched for that turned out to be simple? Are there commands that you’re still looking for and haven’t found yet? Let me know either in the comments or @DevonSchreiner.

Did you like this article? Find more like it over at the brand new VentureBreak.com.

Leave a comment

Your email address will not be published. Required fields are marked *