SlideShare a Scribd company logo
1 of 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!

More Related Content

What's hot

Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking ExplainedThomas Graf
 
Linux User Management
Linux User ManagementLinux User Management
Linux User ManagementGaurav Mishra
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file systemTaaanu01
 
Linux System Monitoring basic commands
Linux System Monitoring basic commandsLinux System Monitoring basic commands
Linux System Monitoring basic commandsMohammad Rafiee
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 
Linux ppt
Linux pptLinux ppt
Linux pptlincy21
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commandsSagar Kumar
 
Introduction to linux ppt
Introduction to linux pptIntroduction to linux ppt
Introduction to linux pptOmi Vichare
 
Linux booting Process
Linux booting ProcessLinux booting Process
Linux booting ProcessGaurav Sharma
 
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)Chinthaka Deshapriya (RHCA)
 
Linux monitoring and Troubleshooting for DBA's
Linux monitoring and Troubleshooting for DBA'sLinux monitoring and Troubleshooting for DBA's
Linux monitoring and Troubleshooting for DBA'sMydbops
 
Users and groups in Linux
Users and groups in LinuxUsers and groups in Linux
Users and groups in LinuxKnoldus Inc.
 
FreeBSD jail+vnetと戯れた話
FreeBSD jail+vnetと戯れた話FreeBSD jail+vnetと戯れた話
FreeBSD jail+vnetと戯れた話Masaru Oki
 

What's hot (20)

Linux file system
Linux file systemLinux file system
Linux file system
 
Linux boot process
Linux boot processLinux boot process
Linux boot process
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
Linux User Management
Linux User ManagementLinux User Management
Linux User Management
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file system
 
Linux System Monitoring basic commands
Linux System Monitoring basic commandsLinux System Monitoring basic commands
Linux System Monitoring basic commands
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Linux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell ScriptingLinux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell Scripting
 
Presentation on linux
Presentation on linuxPresentation on linux
Presentation on linux
 
Linux introduction
Linux introductionLinux introduction
Linux introduction
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
User management
User managementUser management
User management
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Introduction to linux ppt
Introduction to linux pptIntroduction to linux ppt
Introduction to linux ppt
 
Linux booting Process
Linux booting ProcessLinux booting Process
Linux booting Process
 
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
 
Linux monitoring and Troubleshooting for DBA's
Linux monitoring and Troubleshooting for DBA'sLinux monitoring and Troubleshooting for DBA's
Linux monitoring and Troubleshooting for DBA's
 
Linux basics
Linux basicsLinux basics
Linux basics
 
Users and groups in Linux
Users and groups in LinuxUsers and groups in Linux
Users and groups in Linux
 
FreeBSD jail+vnetと戯れた話
FreeBSD jail+vnetと戯れた話FreeBSD jail+vnetと戯れた話
FreeBSD jail+vnetと戯れた話
 

Viewers also liked

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
 

Viewers also liked (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
 

Similar to 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
 

Similar to 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
 

Recently uploaded

COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf203318pmpc
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfRagavanV2
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projectssmsksolar
 

Recently uploaded (20)

COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 

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!