SlideShare uma empresa Scribd logo
1 de 13
Cron
Agenda
● What is cron and crontab?
● How to set cron job with specific
time interval?
● Examples.
Cron
● The software utility cron is a time-based
job scheduler in Unix-like computer
operating systems. People use cron to
schedule jobs (commands or shell scripts)
to run periodically at fixed times, dates, or
intervals.
Cron job
Cron usage
● 0 20 * * * /path/to/script/some_script.sh
● /etc/
Crontab
● Cron is driven by a crontab (cron table)
file, a configuration file that specifies shell
commands to run periodically on a given
schedule.
● Users can have their own individual
crontab files.
Crontab
● crontab -e Edit your crontab file, or create one if it doesn’t
already exist.
●
crontab -l Display your crontab file.
● crontab -r Remove your crontab file.
Cron permissions:
● /etc/cron.allow - If this file exists, it must contain your username
for you to use cron jobs.
● /etc/cron.deny - If the cron.allow file does not exist but the
/etc/cron.deny file does exist then, to use cron jobs, you must not
be listed in the /etc/cron.deny file.
Crontab
● /etc/crontab
Crontab Syntax
●
● 00 4 * * 0 echo "This command is run at 4 am
every Sunday"
Crontab Syntax
● 23 */2 * * * echo "Run at 0:23, 2:23,
4:23, ..."
● 23 1,2 * * 0 echo "Run at 1:23, 2:23 on
sunday"
● 23 2-5 * * sun echo "Run at 2:23, 3:23,
4:23, 5:23 on sunday"
Crontab Syntax
Crontab Syntax
Entry Description Equivalent to
@yearly
(or @annually)
Run once a year at midnight
of January 1
0 0 1 1 *
@monthly Run once a month at
midnight of the first day of
the month
0 0 1 * *
@weekly Run once a week at midnight
on Sunday morning
0 0 * * 0
@daily Run once a day at midnight 0 0 * * *
@hourly Run once an hour at the
beginning of the hour
0 * * * *
@reboot Run at startup @reboot
Thank you for attention!

Mais conteúdo relacionado

Mais procurados

Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemSadia Bashir
 
Memory management in Linux
Memory management in LinuxMemory management in Linux
Memory management in LinuxRaghu Udiyar
 
Linux directory structure by jitu mistry
Linux directory structure by jitu mistryLinux directory structure by jitu mistry
Linux directory structure by jitu mistryJITU MISTRY
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file systemTaaanu01
 
Linux process management
Linux process managementLinux process management
Linux process managementRaghu nath
 
Networking in linux
Networking in linuxNetworking in linux
Networking in linuxVarnnit Jain
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linuxVicent Selfa
 
Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scriptingVIKAS TIWARI
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commandsSagar Kumar
 
Linux Boot Process
Linux Boot ProcessLinux Boot Process
Linux Boot Processdarshhingu
 
Samba server configuration
Samba server configurationSamba server configuration
Samba server configurationRohit Phulsunge
 
Troubleshooting common oslo.messaging and RabbitMQ issues
Troubleshooting common oslo.messaging and RabbitMQ issuesTroubleshooting common oslo.messaging and RabbitMQ issues
Troubleshooting common oslo.messaging and RabbitMQ issuesMichael Klishin
 
File System Hierarchy
File System HierarchyFile System Hierarchy
File System Hierarchysritolia
 

Mais procurados (20)

Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
 
Linux: LVM
Linux: LVMLinux: LVM
Linux: LVM
 
Memory management in Linux
Memory management in LinuxMemory management in Linux
Memory management in Linux
 
Linux directory structure by jitu mistry
Linux directory structure by jitu mistryLinux directory structure by jitu mistry
Linux directory structure by jitu mistry
 
Users and groups
Users and groupsUsers and groups
Users and groups
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file system
 
Linux process management
Linux process managementLinux process management
Linux process management
 
Networking in linux
Networking in linuxNetworking in linux
Networking in linux
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linux
 
Linux file system
Linux file systemLinux file system
Linux file system
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Filepermissions in linux
Filepermissions in linuxFilepermissions in linux
Filepermissions in linux
 
Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scripting
 
Samba server
Samba serverSamba server
Samba server
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Linux Boot Process
Linux Boot ProcessLinux Boot Process
Linux Boot Process
 
Samba server configuration
Samba server configurationSamba server configuration
Samba server configuration
 
Troubleshooting common oslo.messaging and RabbitMQ issues
Troubleshooting common oslo.messaging and RabbitMQ issuesTroubleshooting common oslo.messaging and RabbitMQ issues
Troubleshooting common oslo.messaging and RabbitMQ issues
 
File System Hierarchy
File System HierarchyFile System Hierarchy
File System Hierarchy
 

Destaque

0527 ASUS Cloud day 翻轉思維x學習革命 翻出教育未來式 - project monkeys
0527 ASUS Cloud day 翻轉思維x學習革命  翻出教育未來式 - project monkeys0527 ASUS Cloud day 翻轉思維x學習革命  翻出教育未來式 - project monkeys
0527 ASUS Cloud day 翻轉思維x學習革命 翻出教育未來式 - project monkeysASUSCloud
 
Crowd funding revised
Crowd funding revisedCrowd funding revised
Crowd funding revisedCrossprof.com
 
PPT MOG Intercon Internasional
PPT MOG Intercon InternasionalPPT MOG Intercon Internasional
PPT MOG Intercon Internasionalpariyanti
 
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集ASUSCloud
 
PSYCHO COMIC SLIDES
PSYCHO COMIC SLIDESPSYCHO COMIC SLIDES
PSYCHO COMIC SLIDESLillian June
 
CA Milan Ratnani - Resume
CA Milan Ratnani - ResumeCA Milan Ratnani - Resume
CA Milan Ratnani - ResumeMilanRRatnani
 
The grand design hawking, mlodinow (2010)
The grand design   hawking, mlodinow (2010)The grand design   hawking, mlodinow (2010)
The grand design hawking, mlodinow (2010)drdvinod
 
Lucky Crystal Collections
Lucky Crystal CollectionsLucky Crystal Collections
Lucky Crystal CollectionsJoy Lee
 
Harmony of the seas minicruise okt 2016
Harmony of the seas   minicruise okt 2016Harmony of the seas   minicruise okt 2016
Harmony of the seas minicruise okt 2016Luc De Smedt
 
CiviCRM 5.0 for Non-Techies
CiviCRM 5.0 for Non-TechiesCiviCRM 5.0 for Non-Techies
CiviCRM 5.0 for Non-Techiestonymazz
 

Destaque (20)

Private Label
Private LabelPrivate Label
Private Label
 
0527 ASUS Cloud day 翻轉思維x學習革命 翻出教育未來式 - project monkeys
0527 ASUS Cloud day 翻轉思維x學習革命  翻出教育未來式 - project monkeys0527 ASUS Cloud day 翻轉思維x學習革命  翻出教育未來式 - project monkeys
0527 ASUS Cloud day 翻轉思維x學習革命 翻出教育未來式 - project monkeys
 
Crowd funding revised
Crowd funding revisedCrowd funding revised
Crowd funding revised
 
Instintoysexualidad
InstintoysexualidadInstintoysexualidad
Instintoysexualidad
 
PPT MOG Intercon Internasional
PPT MOG Intercon InternasionalPPT MOG Intercon Internasional
PPT MOG Intercon Internasional
 
Charter airline
Charter airlineCharter airline
Charter airline
 
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集
 
ECONS REPORT
ECONS REPORTECONS REPORT
ECONS REPORT
 
Confident Translation Profile
Confident Translation ProfileConfident Translation Profile
Confident Translation Profile
 
PSYCHO COMIC SLIDES
PSYCHO COMIC SLIDESPSYCHO COMIC SLIDES
PSYCHO COMIC SLIDES
 
Clinical Case 4
Clinical Case 4Clinical Case 4
Clinical Case 4
 
CA Milan Ratnani - Resume
CA Milan Ratnani - ResumeCA Milan Ratnani - Resume
CA Milan Ratnani - Resume
 
The grand design hawking, mlodinow (2010)
The grand design   hawking, mlodinow (2010)The grand design   hawking, mlodinow (2010)
The grand design hawking, mlodinow (2010)
 
ECONS BRIEF
ECONS BRIEFECONS BRIEF
ECONS BRIEF
 
Lucky Crystal Collections
Lucky Crystal CollectionsLucky Crystal Collections
Lucky Crystal Collections
 
Tarea6 adrianamunoz
Tarea6 adrianamunozTarea6 adrianamunoz
Tarea6 adrianamunoz
 
John Mayer
John MayerJohn Mayer
John Mayer
 
Indi go airlines
Indi go airlinesIndi go airlines
Indi go airlines
 
Harmony of the seas minicruise okt 2016
Harmony of the seas   minicruise okt 2016Harmony of the seas   minicruise okt 2016
Harmony of the seas minicruise okt 2016
 
CiviCRM 5.0 for Non-Techies
CiviCRM 5.0 for Non-TechiesCiviCRM 5.0 for Non-Techies
CiviCRM 5.0 for Non-Techies
 

Semelhante a Cron

Linux talk | scheduled tasks
Linux talk | scheduled tasksLinux talk | scheduled tasks
Linux talk | scheduled tasksYashwantVarma1
 
Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Ahmed El-Arabawy
 
unix crontab basics
unix crontab basicsunix crontab basics
unix crontab basicssaratsandhya
 
(Practical) linux 104
(Practical) linux 104(Practical) linux 104
(Practical) linux 104Arie Bregman
 
cronjob-180822194232-1.pdf
cronjob-180822194232-1.pdfcronjob-180822194232-1.pdf
cronjob-180822194232-1.pdfGumanSingh10
 
3.1.c apend scripting, crond, atd
3.1.c apend   scripting, crond, atd3.1.c apend   scripting, crond, atd
3.1.c apend scripting, crond, atdAcácio Oliveira
 
101 apend. scripting, crond, atd
101 apend. scripting, crond, atd101 apend. scripting, crond, atd
101 apend. scripting, crond, atdAcácio Oliveira
 
Linux automated tasks
Linux automated tasksLinux automated tasks
Linux automated tasksyarden hanan
 
Example Stream Setup
Example  Stream  SetupExample  Stream  Setup
Example Stream Setupcfministries
 
Docker 原理與實作
Docker 原理與實作Docker 原理與實作
Docker 原理與實作kao kuo-tung
 
CRONtab Tutorial
CRONtab TutorialCRONtab Tutorial
CRONtab TutorialJoseph ...
 
schedule backup to google drive using Crontab and introdction to crontab
schedule backup to google drive using Crontab and introdction to crontabschedule backup to google drive using Crontab and introdction to crontab
schedule backup to google drive using Crontab and introdction to crontabCharan S
 
Ever Present Persistence - Established Footholds Seen in the Wild
Ever Present Persistence - Established Footholds Seen in the WildEver Present Persistence - Established Footholds Seen in the Wild
Ever Present Persistence - Established Footholds Seen in the WildCTruncer
 
Doctrine Project
Doctrine ProjectDoctrine Project
Doctrine ProjectDaniel Lima
 
Let's Talk Locks!
Let's Talk Locks!Let's Talk Locks!
Let's Talk Locks!C4Media
 
Cassandra Data Modeling
Cassandra Data ModelingCassandra Data Modeling
Cassandra Data ModelingMatthew Dennis
 

Semelhante a Cron (20)

Linux talk | scheduled tasks
Linux talk | scheduled tasksLinux talk | scheduled tasks
Linux talk | scheduled tasks
 
Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2)
 
unix crontab basics
unix crontab basicsunix crontab basics
unix crontab basics
 
Crontab
CrontabCrontab
Crontab
 
(Practical) linux 104
(Practical) linux 104(Practical) linux 104
(Practical) linux 104
 
cronjob-180822194232-1.pdf
cronjob-180822194232-1.pdfcronjob-180822194232-1.pdf
cronjob-180822194232-1.pdf
 
3.1.c apend scripting, crond, atd
3.1.c apend   scripting, crond, atd3.1.c apend   scripting, crond, atd
3.1.c apend scripting, crond, atd
 
101 apend. scripting, crond, atd
101 apend. scripting, crond, atd101 apend. scripting, crond, atd
101 apend. scripting, crond, atd
 
Linux automated tasks
Linux automated tasksLinux automated tasks
Linux automated tasks
 
Example Stream Setup
Example  Stream  SetupExample  Stream  Setup
Example Stream Setup
 
Docker 原理與實作
Docker 原理與實作Docker 原理與實作
Docker 原理與實作
 
Daemons
DaemonsDaemons
Daemons
 
CRONtab Tutorial
CRONtab TutorialCRONtab Tutorial
CRONtab Tutorial
 
schedule backup to google drive using Crontab and introdction to crontab
schedule backup to google drive using Crontab and introdction to crontabschedule backup to google drive using Crontab and introdction to crontab
schedule backup to google drive using Crontab and introdction to crontab
 
Ever Present Persistence - Established Footholds Seen in the Wild
Ever Present Persistence - Established Footholds Seen in the WildEver Present Persistence - Established Footholds Seen in the Wild
Ever Present Persistence - Established Footholds Seen in the Wild
 
Doctrine Project
Doctrine ProjectDoctrine Project
Doctrine Project
 
Let's Talk Locks!
Let's Talk Locks!Let's Talk Locks!
Let's Talk Locks!
 
Week6 filesystem
Week6 filesystemWeek6 filesystem
Week6 filesystem
 
Automation tools: making things go... (March 2019)
Automation tools: making things go... (March 2019)Automation tools: making things go... (March 2019)
Automation tools: making things go... (March 2019)
 
Cassandra Data Modeling
Cassandra Data ModelingCassandra Data Modeling
Cassandra Data Modeling
 

Último

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 

Último (20)

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 

Cron

  • 2. Agenda ● What is cron and crontab? ● How to set cron job with specific time interval? ● Examples.
  • 3. Cron ● The software utility cron is a time-based job scheduler in Unix-like computer operating systems. People use cron to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals.
  • 5. Cron usage ● 0 20 * * * /path/to/script/some_script.sh ● /etc/
  • 6. Crontab ● Cron is driven by a crontab (cron table) file, a configuration file that specifies shell commands to run periodically on a given schedule. ● Users can have their own individual crontab files.
  • 7. Crontab ● crontab -e Edit your crontab file, or create one if it doesn’t already exist. ● crontab -l Display your crontab file. ● crontab -r Remove your crontab file. Cron permissions: ● /etc/cron.allow - If this file exists, it must contain your username for you to use cron jobs. ● /etc/cron.deny - If the cron.allow file does not exist but the /etc/cron.deny file does exist then, to use cron jobs, you must not be listed in the /etc/cron.deny file.
  • 9. Crontab Syntax ● ● 00 4 * * 0 echo "This command is run at 4 am every Sunday"
  • 10. Crontab Syntax ● 23 */2 * * * echo "Run at 0:23, 2:23, 4:23, ..." ● 23 1,2 * * 0 echo "Run at 1:23, 2:23 on sunday" ● 23 2-5 * * sun echo "Run at 2:23, 3:23, 4:23, 5:23 on sunday"
  • 12. Crontab Syntax Entry Description Equivalent to @yearly (or @annually) Run once a year at midnight of January 1 0 0 1 1 * @monthly Run once a month at midnight of the first day of the month 0 0 1 * * @weekly Run once a week at midnight on Sunday morning 0 0 * * 0 @daily Run once a day at midnight 0 0 * * * @hourly Run once an hour at the beginning of the hour 0 * * * * @reboot Run at startup @reboot
  • 13. Thank you for attention!