Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

When a cron job fails on a VPS, check it in layers: confirm the crontab and owning user, verify the five-field schedule, use absolute command paths and an explicit environment, reproduce the command as that user, confirm the cron service is running, then inspect captured output and system logs. For jobs that must survive downtime, also check for missed-run behavior and duplicate systemd or anacron schedules.

The most common cause is not a broken scheduler. It is a job installed in the wrong user’s crontab, a command that depends on an interactive shell, a service that is disabled after reboot, or a file in /etc/cron.d that violates its syntax or filename rules.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start with a layered diagnosis

Work from the job definition outward. This prevents you from changing a schedule when the real problem is a missing executable, wrong account, or stopped service.

  1. List the crontab for the account that should run the job.
  2. Check every schedule field, the intended timezone, and the command text.
  3. Replace relative paths with absolute paths and define required environment variables.
  4. Run the exact command manually as the cron user.
  5. Check whether cron or crond is active and enabled at boot.
  6. Redirect output temporarily and inspect the service journal or syslog.
  7. If the job is system-wide, validate its file syntax, ownership, permissions, and filename.
  8. Look for a systemd timer or anacron implementation that duplicates or replaces the cron job.
  9. Decide whether a missed run after a shutdown should be caught up by a persistent timer or anacron-style scheduler.

1. Confirm the crontab and the account that owns it

Each user has a separate crontab. Debian’s crontab manual states: “Each user has their own crontab, and commands in any given crontab will be executed as the user who owns it.” A line in the application account’s crontab therefore runs with that account’s permissions, home directory, environment, and access to files. A line in root’s crontab does not install the same job for the application account.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

List the intended user’s jobs

crontab -l

Run that command while logged in as the account that should execute the task. For a root-owned job, list root’s crontab explicitly:

sudo crontab -l

If you administer several accounts, repeat the check for each one. A frequent failure pattern is editing a user crontab with sudo crontab -e, then expecting an unprivileged application process to see the entry, or editing the application account’s crontab when the command needs root privileges.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check where the job is defined

Jobs can come from a per-user crontab, /etc/crontab, files in /etc/cron.d, or scripts in /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly. These locations are not interchangeable. System-wide crontab formats include an explicit user field; a per-user crontab does not. Open the file you actually intend to use before changing the line.

2. Validate the schedule, timezone, and command text

A standard cron entry has five schedule fields followed by the command:

Field Allowed values Question to ask
Minute 0–59 Is the minute valid, and is it the minute you intended?
Hour 0–23 Is the VPS using the timezone you assumed?
Day of month 1–31 Does the date exist in the month?
Month 1–12 or names supported by the implementation Is the job restricted to the intended months?
Day of week 0–7 or names supported by the implementation Does the chosen value represent the weekday you expect on this distribution?

Check the VPS timezone with timedatectl where available, and compare it with the timezone used by your application or operations team. A job scheduled for 02:00 local time may run at a different wall-clock time when the server is configured for UTC. Review daylight-saving changes if the exact local minute matters.

Keep comments and quoting unambiguous

Put comments on their own lines while diagnosing. An inline comment or an unmatched quote can change the command that cron passes to the shell. Shell metacharacters, percent signs, and nested quotes deserve special attention; copy the command into a shell prompt and verify that it parses as intended before putting it back in the crontab.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a known-good test schedule temporarily

To distinguish a schedule problem from a command problem, temporarily schedule a harmless test that writes the current time to a file:

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
* * * * * /bin/date >> /tmp/cron-heartbeat.log 2>&1

Wait several minutes, then inspect the file. Remove the heartbeat entry after testing. If it never appears, investigate the service, the crontab location, and permissions before debugging the original application command.

3. Remove interactive-shell assumptions

Cron does not start your normal interactive login session. Startup files such as .bashrc or shell profile scripts may not run, and the working directory may not be your project directory. Commands that work over SSH can therefore fail immediately under cron.

Use absolute executable paths

Find the executable used by the job and put its full path in the entry. Typical examples are /usr/bin/php and /usr/bin/curl; verify the actual path on your VPS with command -v php or command -v curl.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
*/5 * * * * /usr/bin/php /var/www/app/bin/worker.php

Do not rely on a shell alias, a language-version manager loaded only for SSH, or a relative executable name.

Set the environment explicitly

Define a minimal PATH and any variables the command requires. Set the working directory in a wrapper script or change directory explicitly:

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
APP_ENV=production
*/5 * * * * cd /var/www/app && /usr/bin/php bin/worker.php

Use the same configuration file, credentials mechanism, and network endpoint that the application expects, but avoid placing secrets directly in a world-readable crontab. A wrapper script with restricted ownership and mode is usually safer for sensitive values.

Make file locations explicit

Convert paths such as ./storage/output.log or config/settings.yml into absolute paths, or perform an explicit cd first. Cron’s working directory is not guaranteed to be the directory you used during an SSH session. Also confirm that the cron user can traverse every parent directory and write to the destination.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

4. Reproduce the command as the cron user

Run the exact command under the same account, with the same absolute paths, rather than testing it only as root or as your login user:

sudo -u APPUSER -- /absolute/path/to/command --same --arguments

For a script that expects a project directory, reproduce the directory change too:

sudo -u APPUSER -- sh -c 'cd /var/www/app && /usr/bin/php bin/worker.php'

Capture the command’s exit status immediately:

sudo -u APPUSER -- /absolute/path/to/command
printf 'exit status: %sn' "$?"

An exit status other than zero confirms an application, permission, dependency, or input failure independent of cron. Fix that failure first. If the command succeeds manually but fails from cron, compare the environment, working directory, umask, network availability, and file permissions between the two executions.

5. Check whether the cron service is running

The scheduler itself must be active. Debian- and Ubuntu-style systems normally use the cron service; Red Hat-style systems commonly use crond.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Debian or Ubuntu-style commands

systemctl status cron
sudo systemctl enable --now cron

Red Hat-style commands

systemctl status crond
sudo systemctl enable --now crond

The first command shows whether the service is running and reports recent failures. The enable --now form starts it immediately and enables it for future boots. If your distribution uses a different unit name, identify the packaged service and use that exact name rather than enabling both variants.

A service can be running now but disabled at boot, which explains jobs that stop after a VPS reboot. Conversely, a failed service may restart repeatedly; inspect its status output and journal before assuming the crontab is at fault.

6. Capture output and inspect logs

Many cron implementations email command output, but VPS images often have no local mail delivery configured. Redirect stdout and stderr while diagnosing so every failure is recorded:

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
*/5 * * * * cd /var/www/app && /usr/bin/php bin/worker.php >> /var/log/myjob.log 2>&1

Ensure the cron user can create and append to that log. For an unprivileged account, use a writable application log directory instead of /var/log, or create the file with appropriate ownership before testing.

Read the scheduler journal

journalctl -u cron
journalctl -u crond

Use the unit that exists on your distribution. To narrow the search, add a time range such as --since "1 hour ago", then look for the command, account, exit status, permission errors, or an indication that the entry was ignored. Traditional installations may also record cron messages in the relevant syslog facility; inspect the system log when the service journal is empty.

Debian documentation also describes journal inspection for generated cron services. On a system using that implementation, the generated service’s journal can contain the command’s actual failure even when the parent scheduler appears healthy.

7. Validate files in /etc/cron.d and /etc/cron.*

System-wide directories have additional rules that do not apply to a user’s crontab.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

/etc/cron.d syntax

A line in /etc/cron.d includes the five schedule fields, a username, and then the command:

15 2 * * * appuser /usr/bin/php /var/www/app/bin/cleanup.php

The username is mandatory in this format. Copying a line directly from crontab -e and omitting that field shifts the command into the wrong columns, so the file may be ignored or behave unexpectedly.

Ownership, mode, and filename characters

Inspect these files with ls -l. Verify the expected owner, restrictive permissions, and any executable-bit requirement documented by your distribution. Debian’s systemd-cron documentation says generated cron filenames must contain only ASCII letters, digits, underscores, or dashes; a name containing a dot, space, or other character can be ignored. Rename an invalid file and then recheck the scheduler journal.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Periodic directories and run-parts

Hourly, daily, weekly, and monthly directories are commonly processed by run-parts. Red Hat documentation describes that mechanism. A script with an unsupported filename, incorrect mode, missing interpreter, or nonfunctional shebang may be skipped or fail when the directory is scanned. Test the script directly as its intended user, and use a simple filename containing only letters, digits, underscores, or dashes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

8. Investigate reboot and shutdown gaps

A normal cron schedule is evaluated at its scheduled minutes. If the VPS is powered off at that minute, cron does not automatically replay the missed invocation when the machine returns. This is expected behavior, not evidence that the entry disappeared.

Choose the required guarantee

  • If an occasional missed run is acceptable, keep cron and document the behavior.
  • If a periodic task should run after downtime, use an anacron-style strategy appropriate to your distribution or a persistent systemd timer.
  • If the job must run once at an exact wall-clock time, design an explicit recovery or reconciliation step; do not assume ordinary cron provides it.

Debian warns against running duplicate cron and anacron or systemd-cron implementations for the same task because both schedulers can execute the job. Pick one owner for each job and remove or disable the competing entry.

9. Check for systemd timers that replace or duplicate cron

On Debian installations using systemd-cron, crontabs can be translated into generated .timer and .service units. A native timer with a matching name can override a legacy-generated job. This can make a crontab appear correct while a different unit controls the actual execution.

Inventory every timer

systemctl list-timers --all

Look for a timer whose schedule or description matches the cron entry. Inspect its status and generated units before creating a replacement:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
systemctl status NAME.timer
systemctl cat NAME.timer
systemctl cat NAME.service

Read the corresponding journal entries and compare the service’s user, working directory, environment, and command with the old cron definition. Disable one schedule before enabling another; do not leave both active while testing.

Cron or a systemd timer: which should run this job?

Decision factor Cron Systemd timer
Observability Entries are simple and logs usually appear in syslog or the cron service journal. Each run has a unit status and a dedicated journal, making failures and last-run state easier to inspect.
Missed-run persistence Ordinary cron does not catch up after the VPS is off. A suitably configured persistent timer can trigger after downtime.
Dependency ordering Requires shell-level checks or wrapper logic. Can express ordering and relationships with other systemd units.
Environment isolation Requires explicit paths, variables, and directory handling in the entry or wrapper. Environment, user, working directory, and resource controls can be declared in the service unit.
Portability Available across a wide range of Unix-like systems and VPS distributions. Best suited to a VPS already managed by systemd; not portable to non-systemd hosts.
Duplicate-execution risk Can coexist accidentally with anacron or generated systemd jobs. Can coexist accidentally with the original cron entry; inventory existing timers first.

Use cron for a straightforward, portable schedule when exact catch-up and unit dependencies are not required. Prefer a native systemd timer when the VPS is systemd-based and you need persistent missed-run handling, clear journal visibility, dependency ordering, or a tightly controlled service environment. Whichever you choose, maintain one authoritative schedule for the job.

A practical repair example

Suppose a PHP worker runs over SSH but not from cron. Apply the checks in this order:

  1. As the application account, run crontab -l and confirm the entry is in the correct user’s crontab.
  2. Replace a line such as */5 * * * * php bin/worker.php with an explicit directory and executable path: */5 * * * * cd /var/www/app && /usr/bin/php bin/worker.php.
  3. Run sudo -u appuser -- sh -c 'cd /var/www/app && /usr/bin/php bin/worker.php' and record the exit status.
  4. Check systemctl status cron or systemctl status crond, then enable the service at boot if necessary.
  5. Append >> /var/log/myjob.log 2>&1 temporarily, using a log path writable by appuser.
  6. Inspect the relevant journal and application log for missing extensions, denied files, invalid configuration, or network errors.
  7. Run systemctl list-timers --all to ensure a generated or native timer is not replacing the crontab or running the worker a second time.

Once the cause is fixed, remove temporary heartbeat and verbose redirection entries if they are no longer needed, but retain a durable logging path and a documented owner for the schedule.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Common symptoms and the fastest check

Symptom Most useful first check
Nothing runs and there is no log List the intended user’s crontab, then check the cron service status.
It works in SSH only Use absolute paths, set PATH, set the working directory, and run as the cron user.
It stopped after reboot Check whether cron or crond is enabled and running.
The entry is in /etc/cron.d but never fires Verify the username field, ownership, mode, and filename characters.
The job runs twice Compare the crontab with systemctl list-timers --all and anacron or periodic-directory entries.
A run is missing after an outage Confirm whether ordinary cron was offline at the scheduled minute; select a persistent timer or anacron-style catch-up if required.

Final checks before declaring the VPS fixed

  • The entry is in the crontab or system file owned by the intended account.
  • The schedule matches the VPS timezone and has no malformed fields or inline-comment surprises.
  • The command uses absolute paths, an explicit working directory, and all required environment values.
  • The command succeeds when run with sudo -u as the cron user.
  • The correct scheduler service is running and enabled for boot.
  • Output and exit failures are visible in a writable log and in the relevant journal or syslog.
  • System-wide files satisfy their username, ownership, mode, executable, and filename rules.
  • Only one scheduler owns the job, unless deliberate coordination prevents duplicate execution.
  • Missed-run behavior matches the business requirement.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.