Crontab doesn't apply changes edited with crontab-e

Abstract: Resolve crontab changes not applying by verifying editor save, using absolute paths, setting permissions, and checking logs for silent failures.

Created: 2026-10-03 by

The crontab -e command applies changes immediately upon saving the file in your text editor. If modifications appear to be ignored, the issue is rarely with the crontab syntax itself but rather with the environment in which the cron daemon operates or a misunderstanding of how the scheduler executes jobs. Common culprits include incorrect absolute paths, missing environment variables, and log file permission errors.

Understanding How Crontab Saves Changes

When you invoke crontab -e, the system creates a temporary copy of your current crontab file, opens it in your default editor (usually vi or nano), and waits for you to save and exit. Upon exiting the editor successfully, the cron daemon (cron or crond) automatically reads the updated file into memory. There is no separate "apply" button or command required after editing. The change is instantaneous. If you believe the changes were not applied, verify that you actually saved the file and exited the editor cleanly. In vi, this means typing :wq. In nano, this means pressing Ctrl+O then Enter, followed by Ctrl+X. If the editor crashes or hangs, the new crontab may never have been written to disk. You can check the integrity of your crontab by running crontab -l to list the current contents. If your new entries appear here, they are definitely installed.

Common Causes for Apparent Failures

The most frequent reason users think their crontab edits failed is that the job runs but produces no visible output or fails silently. Cron jobs do not inherit the interactive shell environment. This means variables like $PATH, $HOME, and user-specific aliases are often unavailable unless explicitly defined within the crontab file or the script itself. For example, if your script calls python instead of /usr/bin/python3, it will fail because /usr/bin might not be in the cron environment's $PATH. Always use absolute paths for both the executable and any files referenced by the job. Additionally, ensure that the script has executable permissions. A common mistake is creating a script but forgetting to run chmod +x script.sh. Without execute permissions, the cron daemon cannot run the file, resulting in a silent failure. Another critical factor is the working directory. When cron starts a job, its current working directory is usually the user's home directory. If your script expects to be run from a specific project folder, it will fail unless you specify the path relative to the home directory or change directories within the command string using cd /path/to/dir && ./script.sh.

Diagnosing Silent Failures with Logs

To determine if a job is actually running and failing, or if it is not being scheduled at all, you must inspect the system logs. On most Linux distributions, cron activity is logged via syslog. You can view these logs in real-time by running tail -f /var/log/syslog or journalctl -u cron.service -f depending on your init system. Look for lines containing "CRON" and your username. If you see messages indicating that the job was executed, check the standard error output. By default, cron sends email notifications for stdout and stderr if the MAILTO variable is set. However, many modern systems disable mail delivery by default. A more reliable method is to redirect output to a log file within the crontab entry itself. For instance:
* * * * * /path/to/script.sh >> /tmp/cron.log 2>&1
This appends both standard output and standard error to /tmp/cron.log. Check this file after the scheduled time to see any error messages. If the file is empty, the job likely did not run. If it contains errors, they will guide you to the fix, such as missing dependencies or permission denied errors.

Verifying Schedule Syntax

Ensure that your schedule syntax is correct. The five fields represent minute, hour, day of month, month, and day of week. A common typo is placing a number outside the valid range, such as setting the minute field to 60. Also, remember that cron uses 24-hour format. If you want a job to run every minute, use * * * * *. If you suspect the timing is wrong, test with a very short interval, such as * * * * * (every minute) for a few minutes, then revert to the desired schedule. If you are managing multiple users or complex setups, consider checking if the user is allowed to run cron jobs. While rare on modern systems, some configurations restrict cron access via /etc/cron.allow or /etc/cron.deny. If the user is not in the allow list and is in the deny list, or if neither exists but security policies are strict, the job may be silently dropped. For more advanced automation needs, such as transferring files between systems, you might find related techniques useful in our guide on Automating File Transfers between Linux Server and Windows Machine using SSH and Expect Script in Crontab.

Frequently Asked Questions

Why does my crontab job work manually but not via cron?

It almost always works due to environmental differences. Manual execution uses your interactive shell profile, while cron uses a minimal environment. Use absolute paths for all commands and scripts, and define necessary variables directly in the crontab line or script header.

How can I see what errors my cron job is producing?

Redirect both standard output and standard error to a log file in your crontab entry using > /path/to/logfile 2>&1. Then monitor that file or check /var/log/syslog for CRON-related entries to identify specific failure reasons.

Does restarting the cron service apply changes?

No, the cron daemon reads the crontab file only when it is saved via crontab -e or when the daemon starts. Restarting the service is unnecessary for applying edits and should only be done if the daemon itself is unresponsive or stuck.

What if I need to run a job as a different user?

You cannot switch users within a standard user crontab. Instead, edit the root crontab using sudo crontab -e and specify the username before the command, like username /path/to/script.sh. Be cautious with root-level tasks and ensure proper security practices.

Can I use relative paths in crontab?

It is strongly discouraged. Relative paths depend on the working directory, which defaults to the user's home directory in cron. Using relative paths leads to unpredictable behavior. Always use absolute paths for executables and input/output files to ensure reliability.
Tags: Linux Crontab

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More