GAIA Logo
PricingDocs
GAIA Logo
Home/Glossary/Cron Job

Cron Job

A cron job is a command or script that runs automatically on a repeating schedule, such as every night at 2:00 or every Monday at 9:00. The schedule is written as a cron expression with five fields (minute, hour, day of month, month, day of week), and the cron scheduler on Linux, macOS and other Unix systems checks it every minute and starts the job when the time matches.

Understanding Cron Job

The name comes from Chronos, the Greek personification of time. Cron is a Unix utility that runs scheduled commands based on a configuration file (crontab) with expressions defining when each job should run. The syntax allows specification of minutes, hours, days, months, and days of the week.

A cron expression like '0 9 * * 1-5' means: at minute 0, hour 9, any day of month, any month, on weekdays (Monday-Friday), i.e., 9:00 AM on every weekday. This enables precise scheduling of recurring automated tasks.

Cron jobs power background automation: nightly database backups, hourly data syncs, daily report generation, weekly digest emails, and monthly billing cycles are all commonly implemented as cron jobs. For AI assistants, cron jobs trigger scheduled workflows like morning briefings, end-of-day summaries, and weekly review emails.

Modern cloud environments have moved beyond Unix cron to managed scheduling services (AWS EventBridge, Google Cloud Scheduler) and application-level schedulers (Celery Beat, APScheduler, ARQ). These offer better reliability, logging, and monitoring than raw cron.

Reading a cron expression: the five fields are minute (0-59), hour (0-23), day of month (1-31), month (1-12) and day of week (0-6, where 0 is Sunday). An asterisk means every value, a comma lists values (1,15), a hyphen sets a range (1-5) and a slash sets a step (*/15 in the minute field means every 15 minutes). Common examples: 0 2 * * * runs daily at 2:00, */15 * * * * runs every 15 minutes, 0 9 1 * * runs at 9:00 on the first day of each month, and 30 17 * * 5 runs on Fridays at 17:30. If you restrict both day of month and day of week, classic cron runs the job when either one matches, which surprises a lot of people.

Creating a cron job on Linux or macOS: run crontab -e to edit your user's crontab, add one line per job with the expression followed by the command (for example 0 2 * * * /home/me/backup.sh), save, and check the result with crontab -l. Cron starts jobs with a minimal environment, so use absolute paths, set PATH or other variables at the top of the file, and send output to a log file; otherwise errors disappear or land in a local mailbox nobody reads. Jobs run in the machine's time zone unless you configure another one.

Where cron falls short: it does not retry a failed job, it does not run jobs that were due while the machine was off (anacron and systemd timers can), and it does not stop two copies of a slow job from overlapping (wrapping the command in flock does). Kubernetes offers a CronJob resource with the same syntax for containers, and cloud schedulers such as AWS EventBridge Scheduler and Google Cloud Scheduler accept cron expressions too. When the trigger is something happening rather than a time, such as a new email or a new issue, event-driven automation fits better than a cron job.

How GAIA Uses Cron Job

GAIA workflows can run on a cron schedule. Tell GAIA the timing in plain words ("every weekday at 8am") or give a five-field cron expression, and the schedule is evaluated in your time zone. Each run is queued on ARQ, GAIA's Redis-based job queue, and the workflow's steps run in the background, with GAIA able to notify you about the result. A schedule can fire at most once an hour, so expressions that run every minute or every 15 minutes are rejected. Morning briefings, end-of-day summaries and weekly reviews are typical scheduled workflows.

Related Concepts

Workflow Automation

Workflow automation is the use of technology to execute repeatable business processes and tasks automatically, reducing manual effort and human error.

Event-Driven Automation

Event-driven automation (also called event-based automation) runs a workflow the moment something happens, such as a new email arriving, an issue being created or a row being added to a spreadsheet, instead of at a fixed time. Each automation pairs a trigger event with the actions to take, and the system where the event happened notifies the automation platform, usually through a webhook.

Task Automation

Task automation is the use of technology, particularly AI, to automatically create, manage, prioritize, and execute repetitive tasks that would otherwise require manual effort.

Webhook

A webhook is an HTTP callback mechanism where a system sends an automated HTTP request to a specified URL whenever a defined event occurs, enabling real-time notification and integration between services without polling.

Frequently Asked Questions

A cron job is a task set to run automatically at defined times or dates, using cron syntax to specify minutes, hours, days, and weekdays, with no manual trigger needed. Cron jobs power background automation such as nightly backups and hourly syncs, and GAIA uses the same idea for scheduled briefings and recurring workflows.

Yes. GAIA's scheduled workflow feature lets you configure timed triggers. A daily briefing can be scheduled for any time, combining your email summary, calendar overview, task priorities, and any other configured content.

Each scheduled run is a job on ARQ, GAIA's Redis-based queue. A periodic recovery scan re-queues any due run whose job was lost, for example after a worker restart, and resets runs that got stuck mid-execution. A recurring workflow then moves on to its next future time instead of replaying every run it missed. If a run fails, GAIA records the failure and notifies you.

The five fields are minute, hour, day of month, month and day of week. */5 in the minute field means every 5 minutes, and an asterisk in the other fields means every hour, day and month, so */5 * * * * runs every five minutes. Another example: 0 9 * * 1-5 runs at 9:00 on weekdays.

Run crontab -e, add a line with the schedule followed by the command, for example 0 2 * * * /home/me/backup.sh, and save. crontab -l lists your jobs. Use absolute paths and send output to a log file, because cron runs jobs with a minimal environment.

A cron job runs because the clock reached a set time. Event-driven automation runs because something happened, such as a new email or a new GitHub issue. Use cron for regular reports, backups and briefings; use an event trigger when the reaction should follow the event.

Related Automations

Google Calendar + Slack

Get calendar updates in Slack and manage meetings from chat

Slack + Asana

Create Asana tasks from Slack and track progress in chat

Notion + Stripe

Track Stripe revenue in Notion databases and route payment alerts to pages

Explore More

Compare GAIA with Alternatives

See how GAIA stacks up against other AI productivity tools in detailed comparisons

GAIA for Your Role

Discover how GAIA helps professionals in different roles leverage AI for productivity

Stop doing everything yourselfStop doing everything yourself

Join thousands of professionals who gave their grunt work to GAIA.

Twitter IconWhatsapp IconDiscord IconGithub Icon
Product
DownloadUse CasesMarketplaceBotsPricingRoadmap
Explore
Compare GAIAAlternativesAutomationsAI GlossaryGAIA for Your RoleBest AI Assistants
Resources
DocumentationBlogFAQRelease NotesStatusRequest a Feature
Company
AboutManifestoContactBranding
Legal
Terms of UsePrivacy Policy
The Experience Company Inc.
Discord IconTwitter IconGithub IconWhatsapp IconLinkedin Icon