crontab -e no longer changes /var/spool/cron/crontabs/root
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
crontab -e no longer changes /var/spool/cron/crontabs/root
Edits to root's crontab no longer stick. I get no error when I try. A backup version appears in /run/cron (e.g. /run/cron/crontab.lkfqef~). I can edit /var/spool/cron/crontabs/root then restart crond to the same effect, so it's not a problem. I'm just curious as to why it happens.
I can edit other users' crontab files. The same happens with vi, vim, and emacs. I hadn't revised it in years so don't know when this started.
edits the user's crontab. To edit a different user's crontab requires the
Code:
-u
switch. Thus my message witnessed that I was running as root when I tried. If I try to edit root's crontab when I'm running as RandomTroll, crontab returns an error.
That I reported the same result with different editors witnessed that I had set the environment variable crontab reads to decide which editor to use. On my system, that's VISUAL, by the way.
Which makes no difference when I'm already running as root when I run
Code:
crontab -e
. I've been using Linux for 21 years, editing root's crontab files with crontab -e all the time, until recently on my home system it has always worked. There's some kind of protection going on.
I made a mistake in my original message: vi works, vim & emacs don't. vim & emacs create backup files; vi doesn't - don't know why that matters. The backup files remain in /run/cron. Switching to vi is no problem.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.