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

Use cron when a task must run at a particular wall-clock time; use anacron when it must run periodically even if the VPS was powered off at the nominal time. Cron skips a scheduled run when the machine is down. Anacron records periodic completion and runs the task after the system returns, with no more than one anacron run per day. The sections below show where each schedule belongs, how root and user permissions differ, how to survive reboots, and how to verify that jobs actually ran.

Cron and anacron solve different scheduling problems

Both services launch commands automatically, but their timing models are not interchangeable.

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

Cron is a wall-clock scheduler

Cron evaluates a schedule against the current date and time. A line such as 15 2 * * * root /usr/local/sbin/backup.sh means the command is due at 02:15 every day. If the VPS is stopped at 02:15, that occurrence is missed; cron does not normally replay it when the machine starts. Red Hat’s administrator guide summarizes this behavior: “A cron job is only executed if the system is running on the scheduled time.”

Choose cron when the minute matters: a database backup before a morning report, a poll that should run every five minutes, or a report that must be generated at 06:30. It is also the straightforward choice for high-frequency schedules and for jobs whose downstream systems expect a particular timestamp.

#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.

Anacron is a periodic catch-up scheduler

Anacron tracks whether a periodic job has completed. If the VPS is off at the nominal time, it postpones the job until the system is running. Red Hat describes it this way: “If the system is not running at the scheduled time, an anacron job is postponed until the system is running.” An anacron job can run at most once per day, so it is intended for daily, weekly, or monthly maintenance rather than five-minute polling.

Anacron is appropriate for housekeeping where eventual execution is more important than an exact minute: rotating archives, refreshing indexes, pruning temporary files, or producing a periodic report after a reboot. It provides persistence across downtime, but not a guarantee that a weekly task will run at the same clock time each week.

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

Choose the scheduler before writing a line

Requirement Cron Anacron
Timing precision Precise wall-clock fields for minute, hour, date and weekday. Periodic interval with a configurable startup delay; exact clock time is not the primary promise.
VPS down at the scheduled moment The occurrence is skipped. The job is postponed and can run when the VPS is available.
Shortest practical repeat interval Suitable for schedules such as every five minutes. Day-based periods; no more than one run per day.
Typical configuration /etc/cron.d/, /etc/crontab, or a user’s crontab. /etc/anacrontab.
Identity and privileges System files name a user; a user crontab runs as its owner. The command is started by the anacron service context; arrange privileges explicitly, commonly by invoking a root-owned script from the system anacrontab.
Best fit Backups at 02:00, reports at 06:30, and frequent polling. Daily, weekly, or monthly maintenance that must catch up after downtime.

Do not use anacron as a substitute for a time-critical backup window, and do not use cron alone when skipping a maintenance cycle would leave the VPS in an undesirable state. For a task that needs both an exact time and catch-up semantics, split the requirement: use a precise scheduler for the normal run and add a separately designed recovery check that detects missed work.

Prepare the VPS and identify its scheduler implementation

Confirm the operating system and service names

Package names and service names vary by distribution. Red Hat-based systems use the cronie package and the crond.service unit in the documented setup. Debian-family systems use their distribution’s cron package and may integrate cron files with systemd timers. Before editing schedules, identify which implementation is installed and whether another scheduler is already managing the same task.

  1. Check the distribution’s package documentation and install its supported cron implementation if it is absent.
  2. On a Red Hat-based VPS, enable the daemon for future boots and start it now: sudo systemctl enable --now crond.service.
  3. On systems where the unit is named cron, use that unit name instead, for example sudo systemctl status cron.
  4. Record whether anacron, systemd-cron, or native systemd timers are also present. Two schedulers pointed at the same script can create duplicate executions.

Make the script safe to run unattended

Cron starts commands with a restricted, non-interactive environment. Use absolute paths for interpreters and utilities, set any required PATH or other variables in the schedule or wrapper script, and never depend on an interactive shell profile. Make the script executable, ensure its account can read every input and write every destination, and keep credentials in protected files rather than embedding them in a world-readable schedule.

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

Decide where output goes before enabling the job. Redirect standard output and errors to a log, or configure the system’s mail destination for cron output. A silent failure is much harder to diagnose than a failed command with a timestamp and exit status in a log.

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

Create a root cron job

Use a file in /etc/cron.d/ for a separately managed system job; the Red Hat guide presents this as the preferred location. Editing /etc/crontab is also valid when you intentionally manage the central file.

Understand the system-cron fields

System entries contain five time fields, a username, and the command:

minute hour day-of-month month day-of-week username command

The five time fields are minute (0–59), hour (0–23), day of month (1–31), month (1–12), and day of week (the implementation’s documented weekday values). An asterisk means every allowed value. A comma lists alternatives, a hyphen expresses a range, and a slash expresses a step. Check the local cron manual for implementation-specific details before relying on unusual expressions.

Install and protect the file

  1. Create a descriptively named file, such as /etc/cron.d/nightly-backup, as root.
  2. Put one complete entry in the file. This example runs the script at 02:15 daily as root: 15 2 * * * root /usr/local/sbin/backup.sh >> /var/log/backup.log 2>&1.
  3. Use an absolute script path. If the script calls other programs, use absolute paths there too or set PATH explicitly inside the script.
  4. Set ownership and permissions so unprivileged users cannot alter a root-executed command. Follow the permissions accepted by your distribution’s cron daemon; reject writable-by-everyone schedule files.
  5. Run the script manually as the scheduled account before waiting for the first window: sudo -u root /usr/local/sbin/backup.sh. Confirm that the destination is writable and that the expected log output appears.

A root cron entry is powerful: a compromised or accidentally modified script can affect the entire VPS. Keep the script in a root-controlled directory, validate input, and grant narrower privileges when the task does not require root.

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.

Create a per-user cron job

For an application account or another non-root user, edit that account’s crontab with crontab -e. The command runs with the owner’s privileges and the line omits the username field.

15 2 * * * /home/app/bin/backup.sh >> /home/app/log/backup.log 2>&1
  1. Switch to the intended account, or invoke the editor for it with the distribution-supported administrative command.
  2. Run crontab -e and add the five time fields followed directly by the command.
  3. Save and exit; the crontab tool validates and installs the file.
  4. List the installed entries with crontab -l as the same user.
  5. Test the script in that account’s environment. A command that works in your SSH session may fail under cron because its working directory, PATH, home directory, or credentials differ.

Do not add a sixth username field to a user crontab. Conversely, omitting the username in /etc/cron.d/ produces an invalid or misinterpreted system entry.

Use anacron for jobs that must catch up

Edit /etc/anacrontab as root. Each job has four fields:

period delay-in-minutes job-identifier command

The period is expressed in days, the delay defers execution after anacron becomes active, the identifier names the job for tracking, and the final field is the command. Red Hat’s example is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
3 60 cron.daily /usr/local/bin/my-script.sh

This means the command runs every three days, after a 60-minute delay once it is due. The identifier should be unique and descriptive because anacron uses it to record completion.

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.

Install an anacron entry safely

  1. Back up the existing file and open it with root privileges: sudoedit /etc/anacrontab.
  2. Add the period, delay, identifier, and an absolute command path on one line.
  3. Ensure the command is executable and that its user can access every file it touches. Put privileged work in a root-owned wrapper rather than granting broad permissions to data files.
  4. Choose a delay that avoids competing with boot-time services and other maintenance. The delay is in minutes, not seconds.
  5. After saving, inspect the service logs and generated timers on systems that integrate anacron through systemd.

Some Debian systemd-cron implementations document special period tokens such as @daily, @weekly, and @monthly. Traditional anacron accepts only @monthly and @yearly, so do not copy those tokens between distributions without checking the local implementation. Numeric day periods are the most portable form.

Understand reboot and downtime behavior

What happens to a missed cron run

Suppose a cron entry is scheduled for 02:00 and the VPS is powered off from 01:50 until 08:00. Cron was not running at 02:00, so that occurrence is lost. The next occurrence is the following day at 02:00. If the task is a backup or billing export, design an explicit recovery mechanism rather than assuming cron will replay it.

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.

What happens to a missed anacron period

Anacron records periodic completion and checks it when the system is available. If a daily, weekly, or monthly job became due while the VPS was off, anacron postpones it and starts it after the configured delay. It still limits the job to one run per day; a VPS that was down for several weeks does not receive a burst of one run for every missed day.

For weekly work, Debian documentation notes a guaranteed minimum six-day gap between anacron runs. This differs from some persistent systemd timers, which may run once at boot and again at the next calendar boundary. Choose the persistence model deliberately when migrating a job.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Account for Debian systemd-cron and native timers

On Debian systems using systemd-cron, cron files can be translated into systemd timer units. A native systemd timer with the same name takes precedence over the generated cron job. This means an entry can appear correct in a cron file yet be controlled by a timer you did not inspect.

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.

Do not run systemd-cron alongside another cron daemon or a separate anacron instance for the same schedules. Debian warns that doing so can execute scripts more than once. Before enabling a second implementation, map each task to exactly one owner.

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.
  • List active and generated timers with systemctl list-timers.
  • Inspect the cron or systemd journal with journalctl when a generated timer should have fired.
  • After editing /etc/anacrontab, check recent journal entries with journalctl -n and then review systemctl list-timers to confirm timer generation.
  • Search for a same-name native timer before assuming the cron definition is authoritative.

Verify a schedule before trusting it

Check the daemon

Start with the service status. On Red Hat-based systems use systemctl status crond; on distributions that call the service cron, substitute that unit name. A disabled or failed daemon means no schedule will run, regardless of how correct the line looks.

Check the installed entry

  • For a user schedule, run crontab -l as the intended account.
  • For a system schedule, inspect the exact file in /etc/cron.d/ or /etc/crontab and verify the username column.
  • For anacron, inspect /etc/anacrontab, its job identifier, and the period and delay fields.
  • For systemd integration, compare systemctl list-timers with the schedule you expect.

Check execution, not just configuration

Use a temporary test command that writes a timestamp to a user-writable log, or run the production script manually as the target account. Then inspect the cron or system journal and the script’s redirected output. Confirm the VPS timezone: a 02:00 schedule follows the host’s configured clock, not necessarily the timezone on your laptop.

Diagnose the common failure modes

Symptom Likely cause Correction
No jobs run at all The cron service is stopped, disabled, or the wrong unit name was checked. Enable and start the distribution’s daemon, then inspect its status and journal.
Manual execution works, scheduled execution fails Relative paths, missing PATH, a different home directory, or unavailable credentials. Use absolute paths and set required environment variables explicitly; test as the scheduled user.
A root job does not run Missing or misplaced username field, unsafe file permissions, or a non-executable script. Use the seven-field system format, protect the file, and verify the executable bit.
A task runs twice Two cron daemons, anacron plus systemd-cron, or a native timer and generated cron timer own the same command. Choose one scheduler, disable the duplicate, and confirm with service status and timer listings.
An anacron job never appears after editing Unsupported period syntax or failed timer generation. Use a numeric day period for portability and inspect journalctl -n and systemctl list-timers.
Output is missing No redirection or mail destination, or the log directory is not writable. Redirect both output streams to a protected log and verify permissions.

Operational patterns for reliable VPS schedules

Use a wrapper for complex work

Put environment setup, locking, validation, and logging in a version-controlled wrapper script. The cron line then contains one stable absolute path. The wrapper can exit on an unsafe condition before touching production data and can return a meaningful non-zero status for monitoring.

Prevent overlapping runs

A five-minute cron job can still be running when the next invocation arrives. If overlap would corrupt output or overload the VPS, implement a lock in the script or use the locking facility documented by your distribution. Anacron’s one-run-per-day rule does not protect against a manually started copy or a second scheduler.

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

Separate schedule ownership

Document whether each task belongs to a user crontab, /etc/cron.d/, anacron, or a systemd timer. Give the file and script names a matching identifier, and remove obsolete entries when migrating. Clear ownership is the simplest defense against duplicate execution.

Plan for missed and failed work

Anacron handles machine downtime, not every failure. A job that starts and exits with an error may still be considered attempted by the scheduler. Have the script log start and completion, return failure statuses, and alert through the monitoring method used on your VPS. For cron jobs where a missed window matters, record the intended work item and run a separate reconciliation check at startup or on the next schedule.

A practical selection checklist

  • Choose cron if the task must run at a defined minute or more often than once daily.
  • Choose anacron if daily, weekly, or monthly completion matters more than the exact clock time and the VPS may be offline.
  • Use a system file with a username for root or other centrally managed jobs; use crontab -e without a username for per-user work.
  • Use absolute paths, explicit environment variables, protected secrets, and writable log destinations.
  • Verify the daemon, installed entries, service journal, and timer list before declaring the schedule operational.
  • Ensure only one scheduler owns a given command, especially on Debian systems using systemd-cron.

Final guidance

A dependable VPS schedule is a combination of the right timing model, the right execution identity, and observable results. Cron gives precise wall-clock execution but intentionally drops runs during downtime. Anacron trades minute-level precision for persistent periodic execution after the machine returns. Once you match that trade-off to the task, install the entry in the correct file, test it under the real account, and verify the service and logs, routine maintenance can run predictably without an interactive SSH session.

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.

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