Re: trixie and "crontab -e"
On Fri, Nov 07, 2025 at 07:34:07 -0700, D. R. Evans wrote:
> In the past, as an ordinary user, I could edit my crontab file by executing
> "crontab -e": it would display my crontab file in a file editor, and I could
> make changes and save them to the file in the manner that one would expect.
>
> But now when I do that, the terminal instantly says "No modification made",
> and then pops up an editor with a blank file [i.e., NOT my actual crontab
> file] called "crontab".
"No modification made" is the message you get if you don't make any
changes to the file after editing it. You shouldn't be able to see it
before you've exited from the editor, because the editor takes over the
terminal, and crontab shouldn't print the message until you've exited
the editor, which also returns the terminal to the previous screen, so
that you can see your command and its output.
I'm starting to suspect crontab is invoking a terminal that doesn't
work like "nano" or "vi". Maybe it's some emacs client stub thing that
communicates with an emacs daemon thing? Who knows. It would help
if you told us what editor you're using.
To work around that, crontab(1) uses the VISUAL environment variable to
decide which editor to invoke. What happens if you do:
VISUAL=nano crontab -e
> > [ZB:~] crontab -n
> > crontab: usage error: file name must be specified for replace
> > usage: crontab [-u user] [-n] file
> > crontab [ -u user ] [ -i ] { -e | -l | -r }
> >
> > -h (displays this help message)
> >
> > file (default operation is replace, per 1003.2)
> > -n (dry run: checks the syntax, then bails out)
> > -u user (choose the user whose crontab is touched)
> >
> > -e (edit user's crontab)
> > -l (list user's crontab)
> > -r (delete user's crontab)
> >
> > -i (prompt before deleting user's crontab)
> > [ZB:~]
That's what I get as well. -n requires a filename argument.
Reply to: