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.