I do a simple:

crontab -e

In the top of this file, I have:

#DO NOT EDIT THIS FILE - edit the master and reinstall.

And I see that it has opened up some temporary file under /tmp

I am using Gentoo stable, with "vi" as my editor. I have followed the guide at http://wiki.gentoo.org/wiki/Cron#Installation to install dcron.

It is easy to find material on similar issues, i.e. the "DO NOT EDIT THIS FILE" string, however the "solution" is to use "crontab -e" instead of manually editing the file. I am using "crontab -e", but it still opens this temporary file.


That's the default behavior. crontab -e would copy the crontab file to the temporary directory, then use the editor listed in VISUAL or EDITOR environment variables to open this file, when saving, it would then try to copy the file to the original location. This is an atomic operation.

The reasons behind this are varied, from preventing two users to edit the same file at the same time to have a sanity/syntax check before writing the original file.

Ah, the crontab -e also do not trim the file in any way, unless you use Debian.

  • I can accept this, but in my years using cron with crontab -e I have never seen this behavior before. Why am I given the message that I am not to edit the file if this is true? Are you simply telling me to ignore the warning? – AttributedTensorField Oct 3 '14 at 14:28
  • @AttributedTensorField I'm using ISC cron and anacron, but not dcron (which I presume you installed), so my system doesn't show such message, but cron -e behavior is expected, and if it's expected then yes, you can ignore the warning. – Braiam Oct 3 '14 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.