0

In my /etc/crontab

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

We can use crontab to edit a user-defined crontab files under /var/spool/cron/crontabs/, but can't use the same way to edit /etc/crontab or files under /etc/cron.d/. Are they supposed to be edited? If yes, how? Thanks.

1

Use your preferred editor. nano and vim are good editors. The 6th field is the username under which the entry should run.

EDIT:

I have a BSD 4.2 box. I have to export the editor before editing the crontab file on it.

EDITOR=vi
export EDITOR
crontab -e

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.