cron0 2 1 * *

Secrets Rotation — 1st of Month 2 AM

At 02:00, on day 1 of the month

Monthly automated secrets rotation running on the 1st at 2 AM. Rotates API keys, database credentials, and service account tokens in Vault/AWS Secrets Manager and updates downstream consumers.

Monthly1 per month runs/day

Want to customize this schedule or validate your own cron expression?

Try it live →

Field Breakdown

FieldValueMeaning
minute00
hour22
day11
month*every month
weekday*every day of week
0
minute
2
hour
1
day
*
month
*
weekday

Lint Analysis

Info

This time may fall within a DST transition gap for some timezones. Jobs could be skipped or run twice.

Common Use Cases

  • Monthly secrets rotation cron
  • HashiCorp Vault key rotation
  • AWS Secrets Manager rotation
  • API key rotation monthly

Code Examples

Bash / crontab
# Run your script on schedule: 0 2 1 * *
0 2 1 * * /path/to/your/script.sh
Node.js (node-cron)
import cron from 'node-cron';

cron.schedule('0 2 1 * *', () => {
  console.log('Running scheduled task');
});
Python (APScheduler)
from apscheduler.schedulers.blocking import BlockingScheduler

scheduler = BlockingScheduler()

@scheduler.scheduled_job('cron', minute='0', hour='2', day='1')
def my_job():
    print('Running scheduled task')

scheduler.start()

GitHub Actions Workflow

Generate a ready-to-use .github/workflows/schedule.yml file. Customize the name and download directly.

GitHub Actions
# .github/workflows/schedule.yml
name: Secrets Rotation — 1st of Month 2 AM

on:
  schedule:
    - cron: '0 2 1 * *'
  workflow_dispatch: # allow manual trigger

jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Run scheduled task
        run: |
          echo "Running on schedule: 0 2 1 * *"
          # Add your commands here

Save as .github/workflows/schedule.yml in your repository root

Cron Syntax Quick Reference

FieldAllowed ValuesSpecial Chars
minute0–59* , - /
hour0–23* , - /
day of month1–31* , - /
month1–12 or JAN–DEC* , - /
day of week0–7 or SUN–SAT* , - /

Special characters: *= any value  ,= list  -= range  / = step

Related Patterns — Monthly

Need to build your own cron expression from scratch?

Open the Cron Expression Builder →