[{"data":1,"prerenderedAt":162},["ShallowReactive",2],{"cron-guide-en-what-is-a-cron-job":3},{"id":4,"title":5,"author":6,"body":7,"description":144,"extension":145,"faq":146,"meta":153,"navigation":154,"navigationTitle":148,"order":155,"path":156,"publishedAt":157,"seo":158,"slug":159,"stem":160,"updatedAt":157,"__hash__":161},"cron_guides\u002Fen\u002Fguides\u002Fwhat-is-a-cron-job.md","What Is a Cron Job? A Practical Beginner's Guide","ToolkitVault.com",{"type":8,"value":9,"toc":134},"minimark",[10,15,19,22,33,36,39,43,59,63,66,70,77,92,96,103,106,110,113,127,131],[11,12,14],"h2",{"id":13},"how-cron-works","How Cron works",[16,17,18],"p",{},"Cron is a scheduler found on Unix-like systems. The Cron daemon reads schedules from crontab files and starts the associated command when the current date and time match an expression.",[16,20,21],{},"A standard entry contains five schedule fields followed by a command:",[23,24,30],"pre",{"className":25,"code":27,"language":28,"meta":29},[26],"language-text","30 2 * * * \u002Fusr\u002Flocal\u002Fbin\u002Fbackup\n","text","",[31,32,27],"code",{"__ignoreMap":29},[16,34,35],{},"This example starts a backup every day at 02:30.",[16,37,38],{},"A crontab entry can also redirect output, set environment variables or call a wrapper script. Keeping complex logic in a tested script usually makes the schedule easier to read and maintain.",[11,40,42],{"id":41},"common-uses","Common uses",[44,45,46,50,53,56],"ul",{},[47,48,49],"li",{},"Database backups and report generation",[47,51,52],{},"Cache cleanup and log rotation",[47,54,55],{},"Data imports and synchronisation",[47,57,58],{},"Health checks and scheduled notifications",[11,60,62],{"id":61},"safe-setup-checklist","Safe setup checklist",[16,64,65],{},"Use absolute paths, define required environment variables, capture standard output and errors, and test the command under the same user that Cron will use. Prevent overlapping executions when a task can run longer than its interval.",[11,67,69],{"id":68},"user-and-system-crontabs","User and system crontabs",[16,71,72,73,76],{},"Running ",[31,74,75],{},"crontab -e"," edits the current user's schedule. Commands run with that user's permissions and usually receive a smaller environment than an interactive terminal. System crontabs can include an additional username field, so copying an entry between the two formats without checking it can shift the command.",[16,78,79,80,83,84,87,88,91],{},"Common locations include ",[31,81,82],{},"\u002Fetc\u002Fcrontab",", ",[31,85,86],{},"\u002Fetc\u002Fcron.d"," and periodic directories such as ",[31,89,90],{},"\u002Fetc\u002Fcron.daily",". Exact locations and service names vary by operating system.",[11,93,95],{"id":94},"logging-and-troubleshooting","Logging and troubleshooting",[16,97,98,99,102],{},"When a job works in a terminal but fails in Cron, check its user, working directory, ",[31,100,101],{},"PATH",", shell and environment variables. Use absolute executable and file paths. Redirect standard output and standard error to a controlled log, or send them to the system logging service.",[16,104,105],{},"Also confirm that the Cron daemon is running and that the crontab was installed for the intended user. A timezone mismatch is a common explanation when a job runs successfully but at the wrong hour.",[11,107,109],{"id":108},"make-recurring-jobs-reliable","Make recurring jobs reliable",[16,111,112],{},"Design tasks to be safe when repeated. Use a lock when two copies must not overlap, return useful exit codes and alert on repeated failures. For backups, verify the output instead of assuming that a successful command created a usable recovery point. Store secrets outside the crontab and restrict access to any configuration files the job reads.",[16,114,115,116,121,122,126],{},"Paste an existing schedule into the ",[117,118,120],"a",{"href":119},"\u002Fcron-expression-decoder","Cron decoder",", or create one with the ",[117,123,125],{"href":124},"\u002Fcron-expression-generator","Cron expression generator",".",[11,128,130],{"id":129},"cron-systemd-and-cloud-schedulers","Cron, systemd and cloud schedulers",[16,132,133],{},"Cron is ideal for simple recurring tasks on a stable host. Systemd timers offer tighter service integration on Linux. Managed cloud schedulers are often better when jobs need retries, monitoring or high availability.",{"title":29,"searchDepth":135,"depth":135,"links":136},2,[137,138,139,140,141,142,143],{"id":13,"depth":135,"text":14},{"id":41,"depth":135,"text":42},{"id":61,"depth":135,"text":62},{"id":68,"depth":135,"text":69},{"id":94,"depth":135,"text":95},{"id":108,"depth":135,"text":109},{"id":129,"depth":135,"text":130},"Learn what Cron jobs are, how crontab schedules work, where they run and how to test recurring tasks safely.","md",[147,150],{"question":148,"answer":149},"What is a Cron job?","A Cron job is a command or script that a Unix-like system runs automatically according to a recurring schedule.",{"question":151,"answer":152},"Where are Cron jobs stored?","User jobs are commonly stored in a crontab edited with crontab -e. System jobs may also live in \u002Fetc\u002Fcrontab or directories such as \u002Fetc\u002Fcron.d.",{},true,1,"\u002Fen\u002Fguides\u002Fwhat-is-a-cron-job","2026-08-13T12:00:00+02:00",{"title":5,"description":144},"what-is-a-cron-job","en\u002Fguides\u002Fwhat-is-a-cron-job","BPMZcAvCdvX0E1hFs28rIapNdBU5AfPh3Vh7dyNcloc",1786609983178]