Crontab not opening the file to edit
Posted 04-04-2012 at 01:27 PM by LinuxShare
I had previously ran into an issue where the crontab did not open the file to edit due an issue with the default editor path. This can be checked by just trying to open the vi editor from the prompt. If you run into issues in opening a file using 'vi', then crontab -e will not work.
Here is a different case, where 'crontab -e' throws a number back to the screen and does nothing. Example:
crontab -e
442
This number is differing for each user id for which the cron file was tried to edit.
While crontab -e may is not working, crontab -l will list out the contents of the cron file.
A suspected reason for this is incorrect terminal settings.
A very simple workaround in this case is as follows:
1. crontab -l > temp.cron (list the contents of the cron list to a temporary file)
2. vi temp.cron (edit the file to include the new changes)
3. crontab temp.cron (load the contents of the edited file back to the cronlist)
Here is a different case, where 'crontab -e' throws a number back to the screen and does nothing. Example:
crontab -e
442
This number is differing for each user id for which the cron file was tried to edit.
While crontab -e may is not working, crontab -l will list out the contents of the cron file.
A suspected reason for this is incorrect terminal settings.
A very simple workaround in this case is as follows:
1. crontab -l > temp.cron (list the contents of the cron list to a temporary file)
2. vi temp.cron (edit the file to include the new changes)
3. crontab temp.cron (load the contents of the edited file back to the cronlist)
Total Comments 0