Software⏱️ 4 min readπŸ“… 2026-06-11

How to Fix: incrontab -e 'editor finished with error: No such file or directory'

Error fixing incrontab -e with No such file or directory error.

Quick Answer: Check if the /var/spool/cron/cronjobs directory exists and has write permissions, then try editing the incrontab again.

The error 'editor finished with error: No such file or directory' when trying to add an incron entry using `incrontab -e` is typically encountered by users who have not properly installed or configured the editor used for editing the incrontab file. This issue affects users of Linux systems, particularly those running distributions that use a specific text editor as their default configuration.

This error can be frustrating because it prevents the user from successfully adding new cron jobs or modifying existing ones using the incrontab editor. However, by following the steps outlined below, you should be able to resolve this issue and continue using your system's crontab functionality.

πŸ›‘ Root Causes of the Error

  • The primary reason for this error is that the `incrontab` command requires a valid path to an external editor, such as `nano`, `vim`, or `emacs`. If no specific editor is specified when running `incrontab -e`, the system defaults to using `/usr/bin/vi`, which may not be installed or configured correctly on your system. This can lead to the 'No such file or directory' error.
  • An alternative reason for this issue could be that the `/etc/inotify.conf` file is missing or corrupted, which prevents the `incrontab -e` command from finding a valid editor.

πŸ”§ Proven Troubleshooting Steps

Fixing the Editor Configuration

  1. Step 1: First, identify your system's default text editor by running the command `echo $EDITOR`. If no specific editor is specified, you can try setting the default editor to one of the supported options (e.g., `nano` or `vim`) using the following commands: `export EDITOR=nano` (for nano) or `export EDITOR=vim` (for vim).
  2. Step 2: Next, check if the `/usr/bin/vi` command exists and is properly configured. You can do this by running the command `which /usr/bin/vi`. If it does not exist or returns an error message, you may need to reinstall or configure the `vi` package on your system.
  3. Step 3: Finally, try editing the incrontab file again using `incrontab -e`. This should resolve the 'No such file or directory' error and allow you to successfully edit the incrontab file.

Fixing the /etc/inotify.conf File

  1. Step 1: If the `/etc/inotify.conf` file is missing or corrupted, you can try reinstalling the `inotify-tools` package on your system using the following command: `sudo apt-get install -f inotify-tools`. This should restore the configuration to its default state.
  2. Step 2: Alternatively, you can manually edit the `/etc/inotify.conf` file using a supported text editor (e.g., `nano` or `vim`). To do this, run the following commands: `sudo nano /etc/inotify.conf` and make any necessary changes before saving and exiting the editor.

🎯 Final Words

By following these steps, you should be able to resolve the 'editor finished with error: No such file or directory' issue when trying to add an incron entry using `incrontab -e`. Remember to always verify your system's configuration and package versions before attempting any repairs. If you continue to encounter issues, consider seeking further assistance from a Linux system administrator or online support forums.

Did this fix your problem?

If not, try searching for specific error codes.

πŸ” Search Error Database

❓ Frequently Asked Questions