Run Weekly Friday Evening Jobs at 6 PM | CronBase

cron expression Standard
$ 0 18 * * 5

Every Friday evening at six PM

This cron expression schedules a task to run weekly every Friday evening at exactly 6:00 PM. It is commonly deployed in production environments for end-of-week reporting, automated database backups before weekend low-traffic periods, and initiating scheduled maintenance windows that require system-wide validation before operations resume on Monday morning.

Minute
0
Hour
18
Day of Month
*
Month
*
Day of Week
5

Next 5 Runs

  • in 8h 54m
  • in 7d 8h
  • in 14d 8h
  • in 21d 8h
  • in 28d 8h

* Tools

Code & Implementations

nodejs
const cron = require('node-cron');
const logger = require('./logger'); // Assume custom logging module

// Schedule task to run at 18:00 (6 PM) every Friday
cron.schedule('0 18 * * 5', async () => {
  logger.info('Starting weekly Friday evening maintenance task...');
  try {
    await runWeeklyMaintenance();
    logger.info('Weekly maintenance task completed successfully.');
  } catch (error) {
    logger.error('Failed to execute weekly maintenance task:', error);
    // Trigger alerting system (e.g., PagerDuty, Slack webhook)
  }
}, {
  scheduled: true,
  timezone: "Etc/UTC"
});

async function runWeeklyMaintenance() {
  // Production maintenance/reporting logic goes here
}
Setup notes

Install the dependency using 'npm install node-cron', ensure your logger is configured, and run this script as a long-running daemon process.

Partner BetterStack

Monitor this schedule in production

Get alerted the moment this cron job fails, is late, or doesn't run. BetterStack tracks execution, duration, and output — no infrastructure required.

Platform Equivalents

AWS EventBridge

Standard cron expressions often need conversion for AWS EventBridge schedules.

EventBridge Rule
cron(0 18 ? * 5 *)

Systemd Timer

OnCalendarFri *-*-* 18:00:00

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

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

[Install]
WantedBy=timers.target

Frequently Asked Questions

How does daylight saving time affect a Friday 6 PM cron job?

If your server is set to a local timezone that observes DST, the execution time will shift relative to UTC. To prevent unexpected shifts in business logic, set your cron runner to a fixed timezone like UTC, or ensure your scheduling library explicitly handles DST transitions.

What happens if the server is offline at Friday 18:00?

Standard cron engines (like Vixie cron) do not catch up on missed executions. If your server is offline, the job is skipped entirely until the next Friday. For critical jobs, use an orchestrator like Kubernetes CronJobs with a startingDeadlineSeconds policy, or an external scheduling service.

Can I run this job on both Friday and Saturday at 6 PM?

Yes, you can modify the day-of-week field to include both days. In standard cron, changing the expression to 0 18 * * 5,6 will trigger the job at 6 PM on both Friday (5) and Saturday (6).

How can I safely test this weekly cron job without waiting for Friday?

You should separate your job's execution logic from the scheduling configuration. Test the logic independently by running the script or container manually in a staging environment, and use cron parsing tools to validate that the expression resolves to the correct upcoming Friday.

Is it safe to run heavy database migrations using this schedule?

While Friday at 6 PM is often a low-traffic window for B2B applications, running heavy migrations then can ruin your weekend if things go wrong. It is best practice to run migrations during low-traffic hours with active developer supervision, or use blue-green deployments rather than relying on unmonitored Friday night cron jobs.

* Explore

Related expressions you might need

Was this helpful?

Last verified: