[{"data":1,"prerenderedAt":1344},["ShallowReactive",2],{"guide-systemd-timers-vs-cron":3},{"id":4,"title":5,"body":6,"date":1336,"description":1337,"extension":1338,"meta":1339,"navigation":359,"path":1340,"readingTime":664,"seo":1341,"stem":1342,"__hash__":1343},"guides\u002Fguides\u002Fsystemd-timers-vs-cron.md","systemd Timers vs Cron: Which Should You Use?",{"type":7,"value":8,"toc":1297},"minimark",[9,14,18,21,25,194,198,201,206,209,243,247,250,254,261,283,287,290,294,297,301,304,327,331,334,372,376,379,422,426,429,447,451,454,484,488,492,573,577,580,605,612,685,689,694,748,752,833,837,919,923,927,930,987,991,994,1018,1022,1041,1045,1053,1057,1061,1083,1087,1114,1118,1122,1179,1183,1279,1283,1293],[10,11,13],"h2",{"id":12},"introduction","Introduction",[15,16,17],"p",{},"For decades, cron was the undisputed champion of task scheduling on Unix-like systems. Then systemd arrived with its timer units, offering a modern alternative that integrates deeply with the systemd ecosystem.",[15,19,20],{},"This guide compares both approaches across key dimensions, helps you choose the right tool, and provides a practical migration path from cron to systemd timers.",[10,22,24],{"id":23},"feature-comparison","Feature Comparison",[26,27,28,44],"table",{},[29,30,31],"thead",{},[32,33,34,38,41],"tr",{},[35,36,37],"th",{},"Feature",[35,39,40],{},"Cron",[35,42,43],{},"systemd Timers",[45,46,47,62,75,88,105,118,131,150,163,181],"tbody",{},[32,48,49,56,59],{},[50,51,52],"td",{},[53,54,55],"strong",{},"Persistence",[50,57,58],{},"Missed jobs are lost",[50,60,61],{},"Can catch up on missed jobs (persistent timers)",[32,63,64,69,72],{},[50,65,66],{},[53,67,68],{},"Logging",[50,70,71],{},"Requires manual redirection",[50,73,74],{},"Integrated with journalctl",[32,76,77,82,85],{},[50,78,79],{},[53,80,81],{},"Dependencies",[50,83,84],{},"None (runs independently)",[50,86,87],{},"Can depend on other units, network, filesystem mounts",[32,89,90,95,98],{},[50,91,92],{},[53,93,94],{},"Random Delay",[50,96,97],{},"Manual scripting required",[50,99,100,101],{},"Built-in ",[102,103,104],"code",{},"RandomizedDelaySec",[32,106,107,112,115],{},[50,108,109],{},[53,110,111],{},"Accuracy",[50,113,114],{},"Minute-level precision",[50,116,117],{},"Sub-second precision possible",[32,119,120,125,128],{},[50,121,122],{},[53,123,124],{},"User Jobs",[50,126,127],{},"Per-user crontabs",[50,129,130],{},"User timers supported (systemctl --user)",[32,132,133,138,141],{},[50,134,135],{},[53,136,137],{},"Monitoring",[50,139,140],{},"External tools needed",[50,142,143,146,147],{},[102,144,145],{},"systemctl status"," and ",[102,148,149],{},"systemctl list-timers",[32,151,152,157,160],{},[50,153,154],{},[53,155,156],{},"Configuration",[50,158,159],{},"Single crontab file",[50,161,162],{},"Separate timer and service unit files",[32,164,165,170,176],{},[50,166,167],{},[53,168,169],{},"Boot-time Jobs",[50,171,172,175],{},[102,173,174],{},"@reboot"," directive",[50,177,178,175],{},[102,179,180],{},"OnBootSec",[32,182,183,188,191],{},[50,184,185],{},[53,186,187],{},"Resource Limits",[50,189,190],{},"Manual ulimit\u002Fniceness",[50,192,193],{},"Built-in cgroup integration",[10,195,197],{"id":196},"when-to-use-cron","When to Use Cron",[15,199,200],{},"Cron remains the better choice in these scenarios:",[202,203,205],"h3",{"id":204},"_1-simple-frequent-tasks","1. Simple, Frequent Tasks",[15,207,208],{},"If you need a quick one-liner that runs every minute or hour, cron's syntax is faster to write:",[210,211,216],"pre",{"className":212,"code":213,"language":214,"meta":215,"style":215},"language-bash shiki shiki-themes github-light github-dark","*\u002F5 * * * * \u002Fpath\u002Fto\u002Fsimple-script.sh\n","bash","",[102,217,218],{"__ignoreMap":215},[219,220,223,227,231,233,236,238,240],"span",{"class":221,"line":222},"line",1,[219,224,226],{"class":225},"szBVR","*",[219,228,230],{"class":229},"sVt8B","\u002F5 ",[219,232,226],{"class":225},[219,234,235],{"class":225}," *",[219,237,235],{"class":225},[219,239,235],{"class":225},[219,241,242],{"class":229}," \u002Fpath\u002Fto\u002Fsimple-script.sh\n",[202,244,246],{"id":245},"_2-portability-across-systems","2. Portability Across Systems",[15,248,249],{},"Cron works on virtually every Unix-like system—from embedded Linux to macOS to BSD. systemd timers only work on systemd-based systems.",[202,251,253],{"id":252},"_3-quick-user-level-scheduling","3. Quick User-level Scheduling",[15,255,256,257,260],{},"For personal automation scripts, ",[102,258,259],{},"crontab -e"," is faster than creating unit files:",[210,262,264],{"className":212,"code":263,"language":214,"meta":215,"style":215},"crontab -e\n# Add: 0 9 * * 1-5 \u002Fhome\u002Fuser\u002Fmorning-reminder.sh\n",[102,265,266,276],{"__ignoreMap":215},[219,267,268,272],{"class":221,"line":222},[219,269,271],{"class":270},"sScJk","crontab",[219,273,275],{"class":274},"sj4cs"," -e\n",[219,277,279],{"class":221,"line":278},2,[219,280,282],{"class":281},"sJ8bj","# Add: 0 9 * * 1-5 \u002Fhome\u002Fuser\u002Fmorning-reminder.sh\n",[202,284,286],{"id":285},"_4-legacy-system-maintenance","4. Legacy System Maintenance",[15,288,289],{},"If you're maintaining older systems or writing scripts that must work on non-systemd distributions, cron is the safe choice.",[10,291,293],{"id":292},"when-to-use-systemd-timers","When to Use systemd Timers",[15,295,296],{},"systemd timers excel in these situations:",[202,298,300],{"id":299},"_1-tasks-that-must-survive-system-sleephibernation","1. Tasks That Must Survive System Sleep\u002FHibernation",[15,302,303],{},"systemd timers can be configured as persistent, meaning if the system was off when the job should have run, it will execute when the system wakes up:",[210,305,309],{"className":306,"code":307,"language":308,"meta":215,"style":215},"language-ini shiki shiki-themes github-light github-dark","[Timer]\nOnCalendar=daily\nPersistent=true\n","ini",[102,310,311,316,321],{"__ignoreMap":215},[219,312,313],{"class":221,"line":222},[219,314,315],{},"[Timer]\n",[219,317,318],{"class":221,"line":278},[219,319,320],{},"OnCalendar=daily\n",[219,322,324],{"class":221,"line":323},3,[219,325,326],{},"Persistent=true\n",[202,328,330],{"id":329},"_2-jobs-requiring-dependencies","2. Jobs Requiring Dependencies",[15,332,333],{},"Need to ensure the network is up, or a filesystem is mounted? systemd handles this natively:",[210,335,337],{"className":306,"code":336,"language":308,"meta":215,"style":215},"[Unit]\nAfter=network-online.target\nWants=network-online.target\n\n[Timer]\nOnCalendar=hourly\n",[102,338,339,344,349,354,361,366],{"__ignoreMap":215},[219,340,341],{"class":221,"line":222},[219,342,343],{},"[Unit]\n",[219,345,346],{"class":221,"line":278},[219,347,348],{},"After=network-online.target\n",[219,350,351],{"class":221,"line":323},[219,352,353],{},"Wants=network-online.target\n",[219,355,357],{"class":221,"line":356},4,[219,358,360],{"emptyLinePlaceholder":359},true,"\n",[219,362,364],{"class":221,"line":363},5,[219,365,315],{},[219,367,369],{"class":221,"line":368},6,[219,370,371],{},"OnCalendar=hourly\n",[202,373,375],{"id":374},"_3-integrated-logging-and-monitoring","3. Integrated Logging and Monitoring",[15,377,378],{},"systemd timers automatically log to the journal, making debugging easier:",[210,380,382],{"className":212,"code":381,"language":214,"meta":215,"style":215},"# View logs for a specific timer\njournalctl -u my-service.timer -f\n\n# View logs for the associated service\njournalctl -u my-service.service\n",[102,383,384,389,404,408,413],{"__ignoreMap":215},[219,385,386],{"class":221,"line":222},[219,387,388],{"class":281},"# View logs for a specific timer\n",[219,390,391,394,397,401],{"class":221,"line":278},[219,392,393],{"class":270},"journalctl",[219,395,396],{"class":274}," -u",[219,398,400],{"class":399},"sZZnC"," my-service.timer",[219,402,403],{"class":274}," -f\n",[219,405,406],{"class":221,"line":323},[219,407,360],{"emptyLinePlaceholder":359},[219,409,410],{"class":221,"line":356},[219,411,412],{"class":281},"# View logs for the associated service\n",[219,414,415,417,419],{"class":221,"line":363},[219,416,393],{"class":270},[219,418,396],{"class":274},[219,420,421],{"class":399}," my-service.service\n",[202,423,425],{"id":424},"_4-randomized-execution-prevent-thundering-herd","4. Randomized Execution (Prevent Thundering Herd)",[15,427,428],{},"When you have many servers running the same job, use randomized delays to spread the load:",[210,430,432],{"className":306,"code":431,"language":308,"meta":215,"style":215},"[Timer]\nOnCalendar=hourly\nRandomizedDelaySec=1800  # Up to 30 minutes random delay\n",[102,433,434,438,442],{"__ignoreMap":215},[219,435,436],{"class":221,"line":222},[219,437,315],{},[219,439,440],{"class":221,"line":278},[219,441,371],{},[219,443,444],{"class":221,"line":323},[219,445,446],{},"RandomizedDelaySec=1800  # Up to 30 minutes random delay\n",[202,448,450],{"id":449},"_5-resource-constrained-environments","5. Resource-constrained Environments",[15,452,453],{},"Limit CPU, memory, or I\u002FO for the scheduled task:",[210,455,457],{"className":306,"code":456,"language":308,"meta":215,"style":215},"[Service]\nExecStart=\u002Fpath\u002Fto\u002Fresource-heavy-script.sh\nMemoryMax=512M\nCPUQuota=50%\nIOWeight=100\n",[102,458,459,464,469,474,479],{"__ignoreMap":215},[219,460,461],{"class":221,"line":222},[219,462,463],{},"[Service]\n",[219,465,466],{"class":221,"line":278},[219,467,468],{},"ExecStart=\u002Fpath\u002Fto\u002Fresource-heavy-script.sh\n",[219,470,471],{"class":221,"line":323},[219,472,473],{},"MemoryMax=512M\n",[219,475,476],{"class":221,"line":356},[219,477,478],{},"CPUQuota=50%\n",[219,480,481],{"class":221,"line":363},[219,482,483],{},"IOWeight=100\n",[10,485,487],{"id":486},"migration-guide-from-cron-to-systemd-timers","Migration Guide: From Cron to systemd Timers",[202,489,491],{"id":490},"step-1-understand-the-mapping","Step 1: Understand the Mapping",[26,493,494,504],{},[29,495,496],{},[32,497,498,501],{},[35,499,500],{},"Cron Expression",[35,502,503],{},"systemd Timer Equivalent",[45,505,506,518,534,549,561],{},[32,507,508,513],{},[50,509,510],{},[102,511,512],{},"0 * * * *",[50,514,515],{},[102,516,517],{},"OnCalendar=hourly",[32,519,520,525],{},[50,521,522],{},[102,523,524],{},"0 0 * * *",[50,526,527,530,531],{},[102,528,529],{},"OnCalendar=daily"," or ",[102,532,533],{},"OnCalendar=*-*-* 00:00:00",[32,535,536,541],{},[50,537,538],{},[102,539,540],{},"0 0 * * 0",[50,542,543,530,546],{},[102,544,545],{},"OnCalendar=weekly",[102,547,548],{},"OnCalendar=Sun *-*-* 00:00:00",[32,550,551,556],{},[50,552,553],{},[102,554,555],{},"*\u002F15 * * * *",[50,557,558],{},[102,559,560],{},"OnCalendar=*:0\u002F15",[32,562,563,568],{},[50,564,565],{},[102,566,567],{},"0 9 15 * *",[50,569,570],{},[102,571,572],{},"OnCalendar=*-*-15 09:00:00",[202,574,576],{"id":575},"step-2-create-the-service-unit","Step 2: Create the Service Unit",[15,578,579],{},"For a cron job like:",[210,581,583],{"className":212,"code":582,"language":214,"meta":215,"style":215},"0 2 * * * \u002Fhome\u002Fuser\u002Fbackup.sh --full\n",[102,584,585],{"__ignoreMap":215},[219,586,587,590,593,595,597,599,602],{"class":221,"line":222},[219,588,589],{"class":270},"0",[219,591,592],{"class":274}," 2",[219,594,235],{"class":274},[219,596,235],{"class":274},[219,598,235],{"class":274},[219,600,601],{"class":399}," \u002Fhome\u002Fuser\u002Fbackup.sh",[219,603,604],{"class":274}," --full\n",[15,606,607,608,611],{},"Create ",[102,609,610],{},"\u002Fetc\u002Fsystemd\u002Fsystem\u002Fbackup.service",":",[210,613,615],{"className":306,"code":614,"language":308,"meta":215,"style":215},"[Unit]\nDescription=Full system backup\nDocumentation=man:backup(1)\n\n[Service]\nType=oneshot\nExecStart=\u002Fhome\u002Fuser\u002Fbackup.sh --full\nUser=backup-user\nGroup=backup-group\n\n# Optional: Resource limits\nIOSchedulingClass=best-effort\nIOSchedulingPriority=7\n",[102,616,617,621,626,631,635,639,644,650,656,662,667,673,679],{"__ignoreMap":215},[219,618,619],{"class":221,"line":222},[219,620,343],{},[219,622,623],{"class":221,"line":278},[219,624,625],{},"Description=Full system backup\n",[219,627,628],{"class":221,"line":323},[219,629,630],{},"Documentation=man:backup(1)\n",[219,632,633],{"class":221,"line":356},[219,634,360],{"emptyLinePlaceholder":359},[219,636,637],{"class":221,"line":363},[219,638,463],{},[219,640,641],{"class":221,"line":368},[219,642,643],{},"Type=oneshot\n",[219,645,647],{"class":221,"line":646},7,[219,648,649],{},"ExecStart=\u002Fhome\u002Fuser\u002Fbackup.sh --full\n",[219,651,653],{"class":221,"line":652},8,[219,654,655],{},"User=backup-user\n",[219,657,659],{"class":221,"line":658},9,[219,660,661],{},"Group=backup-group\n",[219,663,665],{"class":221,"line":664},10,[219,666,360],{"emptyLinePlaceholder":359},[219,668,670],{"class":221,"line":669},11,[219,671,672],{},"# Optional: Resource limits\n",[219,674,676],{"class":221,"line":675},12,[219,677,678],{},"IOSchedulingClass=best-effort\n",[219,680,682],{"class":221,"line":681},13,[219,683,684],{},"IOSchedulingPriority=7\n",[202,686,688],{"id":687},"step-3-create-the-timer-unit","Step 3: Create the Timer Unit",[15,690,607,691,611],{},[102,692,693],{},"\u002Fetc\u002Fsystemd\u002Fsystem\u002Fbackup.timer",[210,695,697],{"className":306,"code":696,"language":308,"meta":215,"style":215},"[Unit]\nDescription=Run backup daily at 2 AM\nDocumentation=man:backup(1)\n\n[Timer]\nOnCalendar=*-*-* 02:00:00\nPersistent=true\nRandomizedDelaySec=300  # Up to 5 minutes random delay\n\n[Install]\nWantedBy=timers.target\n",[102,698,699,703,708,712,716,720,725,729,734,738,743],{"__ignoreMap":215},[219,700,701],{"class":221,"line":222},[219,702,343],{},[219,704,705],{"class":221,"line":278},[219,706,707],{},"Description=Run backup daily at 2 AM\n",[219,709,710],{"class":221,"line":323},[219,711,630],{},[219,713,714],{"class":221,"line":356},[219,715,360],{"emptyLinePlaceholder":359},[219,717,718],{"class":221,"line":363},[219,719,315],{},[219,721,722],{"class":221,"line":368},[219,723,724],{},"OnCalendar=*-*-* 02:00:00\n",[219,726,727],{"class":221,"line":646},[219,728,326],{},[219,730,731],{"class":221,"line":652},[219,732,733],{},"RandomizedDelaySec=300  # Up to 5 minutes random delay\n",[219,735,736],{"class":221,"line":658},[219,737,360],{"emptyLinePlaceholder":359},[219,739,740],{"class":221,"line":664},[219,741,742],{},"[Install]\n",[219,744,745],{"class":221,"line":669},[219,746,747],{},"WantedBy=timers.target\n",[202,749,751],{"id":750},"step-4-enable-and-start","Step 4: Enable and Start",[210,753,755],{"className":212,"code":754,"language":214,"meta":215,"style":215},"# Reload systemd to recognize new units\nsudo systemctl daemon-reload\n\n# Enable the timer (starts on boot)\nsudo systemctl enable backup.timer\n\n# Start the timer (starts now)\nsudo systemctl start backup.timer\n\n# Verify it's scheduled\nsystemctl list-timers backup.timer\n",[102,756,757,762,773,777,782,794,798,803,814,818,823],{"__ignoreMap":215},[219,758,759],{"class":221,"line":222},[219,760,761],{"class":281},"# Reload systemd to recognize new units\n",[219,763,764,767,770],{"class":221,"line":278},[219,765,766],{"class":270},"sudo",[219,768,769],{"class":399}," systemctl",[219,771,772],{"class":399}," daemon-reload\n",[219,774,775],{"class":221,"line":323},[219,776,360],{"emptyLinePlaceholder":359},[219,778,779],{"class":221,"line":356},[219,780,781],{"class":281},"# Enable the timer (starts on boot)\n",[219,783,784,786,788,791],{"class":221,"line":363},[219,785,766],{"class":270},[219,787,769],{"class":399},[219,789,790],{"class":399}," enable",[219,792,793],{"class":399}," backup.timer\n",[219,795,796],{"class":221,"line":368},[219,797,360],{"emptyLinePlaceholder":359},[219,799,800],{"class":221,"line":646},[219,801,802],{"class":281},"# Start the timer (starts now)\n",[219,804,805,807,809,812],{"class":221,"line":652},[219,806,766],{"class":270},[219,808,769],{"class":399},[219,810,811],{"class":399}," start",[219,813,793],{"class":399},[219,815,816],{"class":221,"line":658},[219,817,360],{"emptyLinePlaceholder":359},[219,819,820],{"class":221,"line":664},[219,821,822],{"class":281},"# Verify it's scheduled\n",[219,824,825,828,831],{"class":221,"line":669},[219,826,827],{"class":270},"systemctl",[219,829,830],{"class":399}," list-timers",[219,832,793],{"class":399},[202,834,836],{"id":835},"step-5-monitor-and-debug","Step 5: Monitor and Debug",[210,838,840],{"className":212,"code":839,"language":214,"meta":215,"style":215},"# Check timer status\nsystemctl status backup.timer\n\n# List all active timers\nsystemctl list-timers --all\n\n# View next scheduled run\nsystemctl list-timers backup.timer --no-pager\n\n# Check service logs after it runs\njournalctl -u backup.service -n 50\n",[102,841,842,847,856,860,865,874,878,883,895,899,904],{"__ignoreMap":215},[219,843,844],{"class":221,"line":222},[219,845,846],{"class":281},"# Check timer status\n",[219,848,849,851,854],{"class":221,"line":278},[219,850,827],{"class":270},[219,852,853],{"class":399}," status",[219,855,793],{"class":399},[219,857,858],{"class":221,"line":323},[219,859,360],{"emptyLinePlaceholder":359},[219,861,862],{"class":221,"line":356},[219,863,864],{"class":281},"# List all active timers\n",[219,866,867,869,871],{"class":221,"line":363},[219,868,827],{"class":270},[219,870,830],{"class":399},[219,872,873],{"class":274}," --all\n",[219,875,876],{"class":221,"line":368},[219,877,360],{"emptyLinePlaceholder":359},[219,879,880],{"class":221,"line":646},[219,881,882],{"class":281},"# View next scheduled run\n",[219,884,885,887,889,892],{"class":221,"line":652},[219,886,827],{"class":270},[219,888,830],{"class":399},[219,890,891],{"class":399}," backup.timer",[219,893,894],{"class":274}," --no-pager\n",[219,896,897],{"class":221,"line":658},[219,898,360],{"emptyLinePlaceholder":359},[219,900,901],{"class":221,"line":664},[219,902,903],{"class":281},"# Check service logs after it runs\n",[219,905,906,908,910,913,916],{"class":221,"line":669},[219,907,393],{"class":270},[219,909,396],{"class":274},[219,911,912],{"class":399}," backup.service",[219,914,915],{"class":274}," -n",[219,917,918],{"class":274}," 50\n",[10,920,922],{"id":921},"advanced-systemd-timer-features","Advanced systemd Timer Features",[202,924,926],{"id":925},"calendar-expressions","Calendar Expressions",[15,928,929],{},"systemd supports rich calendar expressions:",[210,931,933],{"className":306,"code":932,"language":308,"meta":215,"style":215},"# Every 15 minutes\nOnCalendar=*:0\u002F15\n\n# First day of every month at 6 AM\nOnCalendar=*-*-01 06:00:00\n\n# Every Monday and Friday at 9 AM\nOnCalendar=Mon,Fri *-*-* 09:00:00\n\n# Last day of the month\nOnCalendar=*-*~01 23:59:00\n",[102,934,935,940,945,949,954,959,963,968,973,977,982],{"__ignoreMap":215},[219,936,937],{"class":221,"line":222},[219,938,939],{},"# Every 15 minutes\n",[219,941,942],{"class":221,"line":278},[219,943,944],{},"OnCalendar=*:0\u002F15\n",[219,946,947],{"class":221,"line":323},[219,948,360],{"emptyLinePlaceholder":359},[219,950,951],{"class":221,"line":356},[219,952,953],{},"# First day of every month at 6 AM\n",[219,955,956],{"class":221,"line":363},[219,957,958],{},"OnCalendar=*-*-01 06:00:00\n",[219,960,961],{"class":221,"line":368},[219,962,360],{"emptyLinePlaceholder":359},[219,964,965],{"class":221,"line":646},[219,966,967],{},"# Every Monday and Friday at 9 AM\n",[219,969,970],{"class":221,"line":652},[219,971,972],{},"OnCalendar=Mon,Fri *-*-* 09:00:00\n",[219,974,975],{"class":221,"line":658},[219,976,360],{"emptyLinePlaceholder":359},[219,978,979],{"class":221,"line":664},[219,980,981],{},"# Last day of the month\n",[219,983,984],{"class":221,"line":669},[219,985,986],{},"OnCalendar=*-*~01 23:59:00\n",[202,988,990],{"id":989},"multiple-trigger-conditions","Multiple Trigger Conditions",[15,992,993],{},"A timer can have multiple triggers:",[210,995,997],{"className":306,"code":996,"language":308,"meta":215,"style":215},"[Timer]\nOnBootSec=10min        # 10 minutes after boot\nOnCalendar=daily       # Then daily\nOnUnitActiveSec=1h     # Also every hour after service activates\n",[102,998,999,1003,1008,1013],{"__ignoreMap":215},[219,1000,1001],{"class":221,"line":222},[219,1002,315],{},[219,1004,1005],{"class":221,"line":278},[219,1006,1007],{},"OnBootSec=10min        # 10 minutes after boot\n",[219,1009,1010],{"class":221,"line":323},[219,1011,1012],{},"OnCalendar=daily       # Then daily\n",[219,1014,1015],{"class":221,"line":356},[219,1016,1017],{},"OnUnitActiveSec=1h     # Also every hour after service activates\n",[202,1019,1021],{"id":1020},"wake-system-from-suspend","Wake System from Suspend",[210,1023,1025],{"className":306,"code":1024,"language":308,"meta":215,"style":215},"[Timer]\nOnCalendar=08:00\nWakeSystem=true  # Wake the system from suspend if supported\n",[102,1026,1027,1031,1036],{"__ignoreMap":215},[219,1028,1029],{"class":221,"line":222},[219,1030,315],{},[219,1032,1033],{"class":221,"line":278},[219,1034,1035],{},"OnCalendar=08:00\n",[219,1037,1038],{"class":221,"line":323},[219,1039,1040],{},"WakeSystem=true  # Wake the system from suspend if supported\n",[10,1042,1044],{"id":1043},"decision-flowchart","Decision Flowchart",[210,1046,1051],{"className":1047,"code":1049,"language":1050},[1048],"language-text","Is the task simple and portable?\n├─ Yes → Use Cron\n└─ No → Does it need to survive system sleep?\n    ├─ Yes → Use systemd Timer\n    └─ No → Does it need dependencies (network, mounts)?\n        ├─ Yes → Use systemd Timer\n        └─ No → Do you want integrated logging?\n            ├─ Yes → Use systemd Timer\n            └─ No → Use Cron\n","text",[102,1052,1049],{"__ignoreMap":215},[10,1054,1056],{"id":1055},"common-pitfalls","Common Pitfalls",[202,1058,1060],{"id":1059},"cron-pitfalls","Cron Pitfalls",[1062,1063,1064,1071,1077],"ul",{},[1065,1066,1067,1070],"li",{},[53,1068,1069],{},"Silent failures",": No built-in logging; must redirect output manually",[1065,1072,1073,1076],{},[53,1074,1075],{},"Environment differences",": Cron runs with minimal PATH",[1065,1078,1079,1082],{},[53,1080,1081],{},"Missed jobs",": If system is off, the job doesn't run",[202,1084,1086],{"id":1085},"systemd-timer-pitfalls","systemd Timer Pitfalls",[1062,1088,1089,1102,1108],{},[1065,1090,1091,1094,1095,146,1098,1101],{},[53,1092,1093],{},"More files to manage",": Need both ",[102,1096,1097],{},".service",[102,1099,1100],{},".timer"," files",[1065,1103,1104,1107],{},[53,1105,1106],{},"Steeper learning curve",": Unit file syntax is more complex than crontab",[1065,1109,1110,1113],{},[53,1111,1112],{},"systemd dependency",": Only works on systemd-based systems",[10,1115,1117],{"id":1116},"quick-reference","Quick Reference",[202,1119,1121],{"id":1120},"cron-cheat-sheet","Cron Cheat Sheet",[210,1123,1125],{"className":212,"code":1124,"language":214,"meta":215,"style":215},"# Edit user crontab\ncrontab -e\n\n# List cron jobs\ncrontab -l\n\n# System-wide cron\ncat \u002Fetc\u002Fcrontab\nls \u002Fetc\u002Fcron.d\u002F\n",[102,1126,1127,1132,1138,1142,1147,1154,1158,1163,1171],{"__ignoreMap":215},[219,1128,1129],{"class":221,"line":222},[219,1130,1131],{"class":281},"# Edit user crontab\n",[219,1133,1134,1136],{"class":221,"line":278},[219,1135,271],{"class":270},[219,1137,275],{"class":274},[219,1139,1140],{"class":221,"line":323},[219,1141,360],{"emptyLinePlaceholder":359},[219,1143,1144],{"class":221,"line":356},[219,1145,1146],{"class":281},"# List cron jobs\n",[219,1148,1149,1151],{"class":221,"line":363},[219,1150,271],{"class":270},[219,1152,1153],{"class":274}," -l\n",[219,1155,1156],{"class":221,"line":368},[219,1157,360],{"emptyLinePlaceholder":359},[219,1159,1160],{"class":221,"line":646},[219,1161,1162],{"class":281},"# System-wide cron\n",[219,1164,1165,1168],{"class":221,"line":652},[219,1166,1167],{"class":270},"cat",[219,1169,1170],{"class":399}," \u002Fetc\u002Fcrontab\n",[219,1172,1173,1176],{"class":221,"line":658},[219,1174,1175],{"class":270},"ls",[219,1177,1178],{"class":399}," \u002Fetc\u002Fcron.d\u002F\n",[202,1180,1182],{"id":1181},"systemd-timer-cheat-sheet","systemd Timer Cheat Sheet",[210,1184,1186],{"className":212,"code":1185,"language":214,"meta":215,"style":215},"# List active timers\nsystemctl list-timers\n\n# Start\u002Fstop a timer\nsystemctl start backup.timer\nsystemctl stop backup.timer\n\n# Enable\u002Fdisable (boot persistence)\nsystemctl enable backup.timer\nsystemctl disable backup.timer\n\n# View logs\njournalctl -u backup.service\njournalctl -u backup.timer\n",[102,1187,1188,1193,1200,1204,1209,1217,1226,1230,1235,1243,1252,1256,1261,1270],{"__ignoreMap":215},[219,1189,1190],{"class":221,"line":222},[219,1191,1192],{"class":281},"# List active timers\n",[219,1194,1195,1197],{"class":221,"line":278},[219,1196,827],{"class":270},[219,1198,1199],{"class":399}," list-timers\n",[219,1201,1202],{"class":221,"line":323},[219,1203,360],{"emptyLinePlaceholder":359},[219,1205,1206],{"class":221,"line":356},[219,1207,1208],{"class":281},"# Start\u002Fstop a timer\n",[219,1210,1211,1213,1215],{"class":221,"line":363},[219,1212,827],{"class":270},[219,1214,811],{"class":399},[219,1216,793],{"class":399},[219,1218,1219,1221,1224],{"class":221,"line":368},[219,1220,827],{"class":270},[219,1222,1223],{"class":399}," stop",[219,1225,793],{"class":399},[219,1227,1228],{"class":221,"line":646},[219,1229,360],{"emptyLinePlaceholder":359},[219,1231,1232],{"class":221,"line":652},[219,1233,1234],{"class":281},"# Enable\u002Fdisable (boot persistence)\n",[219,1236,1237,1239,1241],{"class":221,"line":658},[219,1238,827],{"class":270},[219,1240,790],{"class":399},[219,1242,793],{"class":399},[219,1244,1245,1247,1250],{"class":221,"line":664},[219,1246,827],{"class":270},[219,1248,1249],{"class":399}," disable",[219,1251,793],{"class":399},[219,1253,1254],{"class":221,"line":669},[219,1255,360],{"emptyLinePlaceholder":359},[219,1257,1258],{"class":221,"line":675},[219,1259,1260],{"class":281},"# View logs\n",[219,1262,1263,1265,1267],{"class":221,"line":681},[219,1264,393],{"class":270},[219,1266,396],{"class":274},[219,1268,1269],{"class":399}," backup.service\n",[219,1271,1273,1275,1277],{"class":221,"line":1272},14,[219,1274,393],{"class":270},[219,1276,396],{"class":274},[219,1278,793],{"class":399},[10,1280,1282],{"id":1281},"related-tools","Related Tools",[1062,1284,1285],{},[1065,1286,1287,1292],{},[1288,1289,1291],"a",{"href":1290},"\u002Ftools\u002Fcron-parser","Cron Parser"," - Decode and validate cron expressions",[1294,1295,1296],"style",{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}",{"title":215,"searchDepth":278,"depth":278,"links":1298},[1299,1300,1301,1307,1314,1321,1326,1327,1331,1335],{"id":12,"depth":278,"text":13},{"id":23,"depth":278,"text":24},{"id":196,"depth":278,"text":197,"children":1302},[1303,1304,1305,1306],{"id":204,"depth":323,"text":205},{"id":245,"depth":323,"text":246},{"id":252,"depth":323,"text":253},{"id":285,"depth":323,"text":286},{"id":292,"depth":278,"text":293,"children":1308},[1309,1310,1311,1312,1313],{"id":299,"depth":323,"text":300},{"id":329,"depth":323,"text":330},{"id":374,"depth":323,"text":375},{"id":424,"depth":323,"text":425},{"id":449,"depth":323,"text":450},{"id":486,"depth":278,"text":487,"children":1315},[1316,1317,1318,1319,1320],{"id":490,"depth":323,"text":491},{"id":575,"depth":323,"text":576},{"id":687,"depth":323,"text":688},{"id":750,"depth":323,"text":751},{"id":835,"depth":323,"text":836},{"id":921,"depth":278,"text":922,"children":1322},[1323,1324,1325],{"id":925,"depth":323,"text":926},{"id":989,"depth":323,"text":990},{"id":1020,"depth":323,"text":1021},{"id":1043,"depth":278,"text":1044},{"id":1055,"depth":278,"text":1056,"children":1328},[1329,1330],{"id":1059,"depth":323,"text":1060},{"id":1085,"depth":323,"text":1086},{"id":1116,"depth":278,"text":1117,"children":1332},[1333,1334],{"id":1120,"depth":323,"text":1121},{"id":1181,"depth":323,"text":1182},{"id":1281,"depth":278,"text":1282},"2026-05-26","Compare systemd timers and cron jobs. Learn the differences in reliability, logging, dependencies, and random delays. Migration guide included.","md",{"immutable":359},"\u002Fguides\u002Fsystemd-timers-vs-cron",{"title":5,"description":1337},"guides\u002Fsystemd-timers-vs-cron","_RoKlFmKXFecZME56ZUKmtp7mSoa_kKN75_nfMNZJoo",1780401324682]