Run Daily 6 PM Tasks Efficiently | CronBase

cron expression Standard
$ 0 18 * * *

Every day in the evening at six PM.

The `0 18 * * *` cron expression schedules a task to execute every day precisely at 18:00 (6:00 PM) in the system's local timezone. It is widely used for executing end-of-day business processes, daily database backups, generating financial reports, and initiating routine maintenance tasks after standard working hours.

Minute
0
Hour
18
Day of Month
*
Month
*
Day of Week
*
How it works

Next 5 Runs

  • in 21h 19m
  • in 1d 21h
  • in 2d 21h
  • in 3d 21h
  • in 4d 21h

* Tools

Code & Implementations

Bash
#!/usr/bin/env bash
set -euo pipefail

# Lock file to prevent concurrent execution if a previous job is still running
LOCKFILE="/var/tmp/daily_backup_1800.lock"

exec 9>>"$LOCKFILE"
if ! flock -n 9; then
    echo "[$(date)] Error: Another instance of the daily 6 PM backup job is already running." >&2
    exit 1
fi

echo "[$(date)] Starting daily end-of-day synchronization task..."
# Place your actual production task execution here
# Example: pg_dump -U db_user -h db_host production_db > /backups/daily_$(date +%F).sql

echo "[$(date)] End-of-day synchronization completed successfully."
Setup notes

Save this script as /usr/local/bin/daily_backup.sh, make it executable with chmod +x, and add the following entry to your system crontab using crontab -e: 0 18 * * * /usr/local/bin/daily_backup.sh >> /var/log/daily_backup.log 2>&1

Last verified:

Partner UptimeRobot

Keep this cron job monitored 24/7

UptimeRobot alerts you the moment a scheduled job stops responding. Free plan monitors up to 50 endpoints — no credit card required.

Platform Equivalents

AWS EventBridge

Standard cron expressions often need conversion for AWS EventBridge schedules.

EventBridge Rule
cron(0 18 * * ? *)

Systemd Timer

OnCalendar*-*-* 18:00:00

my-task.timer
[Unit]
Description=Timer for cron expression: 0 18 * * *

[Timer]
OnCalendar=*-*-* 18:00:00
Persistent=true

[Install]
WantedBy=timers.target

Last verified:

Frequently Asked Questions

What happens to a 6 PM cron job during Daylight Saving Time (DST) changes?

If your system timezone is set to a region observing DST (like America/New_York), the job will execute at 18:00 local time year-round. However, this means the interval between runs will be 23 hours in the spring and 25 hours in the autumn. To maintain strict 24-hour intervals, run your servers and cron engines in UTC.

How can I prevent a long-running 18:00 job from overlapping with the next day's run?

For standard cron, wrap your script with the `flock` utility to enforce a file lock. In Kubernetes, configure `concurrencyPolicy: Forbid` in your CronJob spec. For application-level tasks, implement distributed locking with Redis (Redlock) or database-backed locks.

Is 18:00 (6:00 PM) a good time to schedule intensive database backups?

Only if your user base is inactive at that time. For many business-to-business (B2B) applications, 18:00 local time is when users log off, making it ideal. However, for global or consumer-facing services, 18:00 represents peak evening traffic. Analyze your traffic patterns and schedule heavy IO tasks during off-peak windows.

How do I test my daily 18:00 job without waiting until 6 PM?

You can trigger the job manually. In Kubernetes, use `kubectl create job --from=cronjob/daily-reconciliation-job test-job`. In Linux systems, run the target script directly with the same environment variables as the cron daemon, or temporarily modify the schedule to run a few minutes from the current time.

Why did my daily 18:00 cron job fail to execute silently?

Silent failures are usually caused by the cron daemon dying, the target script lacking execution permissions, or missing environment variables. Cron runs with a highly restricted path environment. Always use absolute paths for executables and redirect both stdout and stderr to a log file or an external monitoring platform.

* Explore

Related expressions you might need

Last verified:

Was this helpful?