6

I've previously set a file to be crontab source file with crontab filename. How can I set it back to use default source? (the one that is modified with crontab -e)

Thank you.

  • 1
    Can you explain more? what exactly does "set a file to be crontab source file with crontab filename" mean? What commands or steps did you do,exactly? – steeldriver Jul 1 '16 at 13:19
  • I ran crontab some_file.txt but I totally misunderstood what it does. I explained some more in the reply to @nobody's answer. – Nina Jul 2 '16 at 17:31
10

Try (in terminal): $ crontab -r where the -r flag removes current crontab configuration.

You can also use $ crontab -e and manually delete everything inside.

Other options are:

  • -l to list crontab configuration
  • -e to edit crontab configuration

To edit someone else's crontab you can use -u followed by the corresponding username.

| improve this answer | |
  • Correct answer ! -- @Nina, please help yrself anytime to $ man crontab in terminal. Man pages are yr friend. -- Something else to be added perhaps to make above answer slightly more complete: A user crontab is logically created the first time a user edits its crontab. It is located at /var/spool/cron/crontabs/user where user is the username know to yr system. You'll never have to go there though. Always use $ crontab -e to edit yr crontab and $ crontab -l to merely list its content. After removing yr crontab you can start again with a clean slate just typing $ crontab -e. – Cbhihe Jul 1 '16 at 13:49
  • Okay this is silliness on my part. I read this superuser.com/a/391248 and somehow conclude that running crontab some_file.txt will set some_file.txt as the crontab source file (as in, cron would regularly scan that file instead). So it doesn't and will only reinstall crontab with some_file.txt content, and crontab -e and saving will reinstall crontab as usual (right?). Thank you for the answer! – Nina Jul 2 '16 at 16:40

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.