-1

This question already has an answer here:

This is intentionally a duplicate of the following question (because the answers there are not completely correct, and as a new user I somehow cannot comment there): Editing crontab

ADDED NOTE: The "How do I set up a Cron job?" question too wrongly states that "sudo crontab -e" edits /etc/crontab (it does NOT) - it IS marked as a duplicate of the "Editing crontab" question.

(hoping to get some upvotes here, so I can help correcting wrong answers in the intended way)

marked as duplicate by N0rbert, user535733, karel, Zanna, muru Oct 19 '18 at 1:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • "Intentionally a duplicate" will be promptly closed as a duplicate - nobody will be able to find it. When you have enough reputation, then add your answer to that question. – user535733 Oct 18 '18 at 17:22
  • How weird - a post motivated by the forum being dysfunctional immediately receives two comments illustrating exactly that. Is no one here interested in getting correct answers? Allow me to point out again - the post marked as a possible duplicate is in error, and exactly the reason why I posted this duplicate question. Who cleans out low-quality answers like that? "sudo crontab -e" does NOT edit /etc/crontab – Johan E. Bengtsson Oct 18 '18 at 19:21
  • There are two things you could do to improve the quality of answers to a question without having any reputation: 1) Post your own, better answer. 2) Suggest (an) edit(s) to any of the answers to make small corrections, fix formatting, add details, etc. If you reach 5 reputation points (suggest 2 edits that are approved), you can also post on meta asking for help improving the Q&A. I'm voting to close this question because it's unclear what you're asking. If you edited it to be more meta, I would vote to migrate to meta. If you removed the meta content, I would vote to close it as a duplicate. – Zanna Oct 18 '18 at 19:45
  • Thanks for trying to give advice, but - how do these referrals to previous duplicate questions with incorrect answers get a fix then? I CANNOT add anything to those questions (neither the latest question nor the previous duplicates), since reputation appears to be needed. I tried to provide a quality answer to the relevant question here. – Johan E. Bengtsson Oct 18 '18 at 20:38
  • Oh I see, my bad, sorry! The question is protected. I've just unprotected it so you can add your answer there. It has had a lot of spam and non-answer answers posted on it, so it'll need to be protected again after you've done so (you can notify me by including @Zanna in a comment here, but other users could also protect the question) The one you linked to in your question is closed as a duplicate so cannot be answered, but the answers can be edited. – Zanna Oct 18 '18 at 21:32
0

Per-user CRON jobs are best handled with the crontab command, crontab -l for showing your own CRON jobs, crontab -e for editing (some syntax errors will be detected), and crontab -r for removing all your CRON jobs (don't do that...). sudo crontab does the same, for the root user.

Duplicate questions have accepted answers that wrongly claim that sudo crontab -e edits /etc/crontab. It does NOT, it edits /var/spool/cron/crontabs/root. I have verified this in Ubuntu 14.04 and Ubuntu 18.04.

/etc/crontab is a system-wide file that can run jobs as any user, typically stored as fragments in /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly and /etc/cron.monthly. For precise control of timing and user, add fragments in /etc/cron.d/ .

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