Run Weekly Friday Afternoon Tasks | CronBase

cron expression Standard
$ 0 17 * * 5

Every Friday afternoon at five o'clock

This cron expression schedules a task to execute weekly every Friday at exactly 5:00 PM. It is widely used in enterprise environments for compiling weekly business reports, triggering pre-weekend database backups, or shutting down non-essential staging environments to optimize cloud infrastructure costs over the weekend.

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

Next 5 Runs

  • in 7h 1m
  • in 7d 7h
  • in 14d 7h
  • in 21d 7h
  • in 28d 7h

* Tools

Code & Implementations

nodejs
const cron = require('node-cron');
const { exec } = require('child_process');

// Schedule task to run every Friday at 17:00 (5:00 PM)
cron.schedule('0 17 * * 5', () => {
  console.log('[INFO] Initiating Friday afternoon teardown tasks...');
  
  exec('/usr/local/bin/teardown-staging.sh', (error, stdout, stderr) => {
    if (error) {
      console.error(`[ERROR] Teardown failed: ${error.message}`);
      return;
    }
    if (stderr) {
      console.warn(`[WARN] Standard Error Output: ${stderr}`);
    }
    console.log(`[SUCCESS] Teardown output:\n${stdout}`);
  });
}, {
  scheduled: true,
  timezone: "America/New_York"
});
Setup notes

Install 'node-cron' using npm. This script schedules the task using a specified timezone to avoid issues with daylight saving transitions.

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 17 ? * 5 *)

Systemd Timer

OnCalendarFri *-*-* 17:00:00

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

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

[Install]
WantedBy=timers.target

Frequently Asked Questions

How does daylight saving time affect this Friday 5 PM schedule?

If your system clock is set to a local timezone that observes DST, the execution will shift relative to UTC twice a year. To maintain a consistent absolute interval or avoid running during transition hours, configure your cron daemon or orchestrator to run strictly on UTC.

Is it safe to run production deployments using this Friday afternoon cadence?

Generally, deploying software changes at 5:00 PM on a Friday is discouraged to prevent weekend on-call fatigue. However, it is an excellent window for read-only tasks, staging environment teardowns, or generating weekly performance metrics.

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

Standard cron daemons will skip the execution entirely if the system is offline during the exact minute. If you require guaranteed execution once the server recovers, consider using tools like anacron or configuring a modern workflow orchestrator with retry policies.

How can I add a random delay to prevent resource spikes at 5:00 PM?

To prevent multiple instances from hitting your databases simultaneously, you can introduce a random sleep command in your execution script. For example, prepending 'sleep $((RANDOM % 300))' will spread the start times across a five-minute window.

Can I run this schedule on both Friday and Saturday at 5 PM?

Yes, you can modify the day-of-week field to include Saturday. By changing the expression to '0 17 * * 5,6', the system will trigger the specified job at 5:00 PM on both Fridays and Saturdays.

* Explore

Related expressions you might need

Was this helpful?

Last verified: