About Cron: The Linux Cron Job is a utility that can be used to execute or shedule a particular task
in the background at a specific time/date on an on-going basis. It is very helpful to get done the tasks automatically at the background and also time saving.
Linux Crontab Format
MIN
Minute field
0 to 59
HOUR
Hour Field
0 to 23
DOM
Day of Month
1 to 31
MON
Month Filed
1 to 12
DOW
Day of Week
0 to 6
CMD
Command
Command to be executed
Commands:
1. Scheduling a Job For a Specific Time
As already said, the basic intention behind the cron is to execute or run a specific job(task) in a specified time.
The cron given below will trigger the full back-up shell script(full-backup) on the specified time in the job.
30 07 08 09 * /home/sam/full-backup
30 – 30th Minute
07 – 07 AM
08 – 08th Day
09 – 9th Month (sept)
* – Every day of the week
2. Schedule a Job For Multiple Instance
We can schedule the cron to run at multiple instances, this will help to run the scripts at two different time specofied in the script. (for example twice a day).
The time instances are seperated using a comma operator in the script.
The following command will take the incremental backup (incremental-backup) shell script in the times specified.
00 11,16 * * * /home/sam/bin/incremental-backup
00 -0th Minute (Top of the hour)
11,16 – 11 AM and 4 PM
- – Every day
- – Every month
* – Every day of the week
3. Schedule a Job for Specific Range of Time
It helps to schedule a job for a specic range of time or in certain intervals.
An example to check the dabase status is shown below(every day) during the specified hours.
00 09-18 * * * /home/sam/bin/check-db-status
00 – 0th Minute (Top of the hour)
09-18 – 9 am, 10 am,11 am, 12 am, 1 pm, 2 pm, 3 pm, 4 pm, 5 pm, 6 pm
- -Every day
- -Every month
* -Every day of the week
The above cron job can be also set to check-db-status on every week days using the command shown below.
00 09-18 * * 1-5 /home/sam/bin/check-db-status
4. Command to view current cronjob entries for a user
The current logged-in user’s crontab entries can be viewed using the following command.
veeble@EcLinux:~$ crontab -l
no crontab for veeble
5. Command to view current cronjob entries for the root
The current root crontab entries can be viewed using the following command.
root@NixLinux:~$ crontab -l @monthly /home/veeble/monthly-backup 00 09-18 * * * /home/sathiya/check-db-status
6. Schedule a Job for Every Minute Using Cron
Ideally you may not have a requirement to schedule a job every minute. But understanding this example will will help you understand the other examples mentioned below in this article.
- * * * * CMD
*/5 in minute field indicates every 5 minutes.
0-10/2 in minute field inidicates every 2 minutes in the first 10 minute.
So, we can use the above method for all the other 4 fields.
Schedule a Background Cron Job For Every 10 Minutes
*/10 * * * * /home/sam/check-disk-space
Instead of specifying values in the 5 fields, we can specify it using a single keyword as mentioned below.
There are special cases in which instead of the above 5 fields we can use @ followed by a keyword such as reboot, midnight, yearly, hourly.
Keyword Equivalent
@yearly 0 0 1 1 *
@daily 0 0 * * *
@hourly 0 * * * *
@reboot Run at start up
a) Schedule a Job For First Minute of Every Year using @yearly
@yearly /home/sam/red-hat/bin/annual-maintenance
b) Schedule a Cron Job Beginning of Every Month using @monthly
@monthly /home/sam/red-hat/bin/annual-maintenance
c) Schedule a Background Job Every Day using @daily
@daily /home/sam/red-hat/bin/annual-maintenance
d) How to Execute a Linux Command After Every Reboot using @reboot?
@reboot CMD
Enjoy freedom with Linux, its awesome π
ΠΠ±ΡΠ°ΡΠΈΡΠ΅ΡΡ Π·Π° ΠΏΠΎΠΌΠΎΡΡΡ ΠΊ ΠΏΡΠΎΡΠ΅ΡΡΠΈΠΎΠ½Π°Π»Π°ΠΌ Π½Π° [url=https://yuridicheskaya-konsultaciya34.ru]ΠΏΠΎΠΌΠΎΡΡ ΡΡΠΈΡΡΠ° Π±Π΅ΡΠΏΠ»Π°ΡΠ½ΠΎ ΠΏΠΎ ΡΠ΅Π»Π΅ΡΠΎΠ½Ρ[/url], ΠΈ ΠΏΠΎΠ»ΡΡΠΈΡΠ΅ ΠΊΠ²Π°Π»ΠΈΡΠΈΡΠΈΡΠΎΠ²Π°Π½Π½ΠΎΠ΅ ΡΠ΅ΡΠ΅Π½ΠΈΠ΅ ΡΠ²ΠΎΠΈΡ Π²ΠΎΠΏΡΠΎΡΠΎΠ².
ΡΠ°ΠΉΡ yuridicheskaya-konsultaciya34.ru ΠΏΡΠ΅Π΄Π»Π°Π³Π°Π΅Ρ ΠΏΡΠΎΡΠ΅ΡΡΠΈΠΎΠ½Π°Π»ΡΠ½ΡΠ΅ ΡΡΠΈΠ΄ΠΈΡΠ΅ΡΠΊΠΈΠ΅ ΡΡΠ»ΡΠ³ΠΈ, Π½Π°ΠΏΡΠ°Π²Π»Π΅Π½Π½ΡΠ΅ Π½Π° ΡΠ΅ΡΠ΅Π½ΠΈΠ΅ ΡΠ°Π·Π»ΠΈΡΠ½ΡΡ ΠΏΡΠ°Π²ΠΎΠ²ΡΡ Π²ΠΎΠΏΡΠΎΡΠΎΠ². ΠΡΡΠΏΠΏΠ° ΠΊΠ²Π°Π»ΠΈΡΠΈΡΠΈΡΠΎΠ²Π°Π½Π½ΡΡ ΡΠΏΠ΅ΡΠΈΠ°Π»ΠΈΡΡΠΎΠ² Π³ΠΎΡΠΎΠ²Π° ΠΏΠΎΠΌΠΎΡΡ Π²Π°ΠΌ Π² ΡΠ°ΠΌΡΡ ΡΠ»ΠΎΠΆΠ½ΡΡ ΡΠΈΡΡΠ°ΡΠΈΡΡ . ΠΠΎΠ½ΠΈΠΌΠ°Ρ, ΡΡΠΎ ΠΏΡΠ°Π²ΠΎΠ²ΡΠ΅ ΠΏΡΠΎΠ±Π»Π΅ΠΌΡ ΠΌΠΎΠ³ΡΡ Π±ΡΡΡ ΡΡΡΠ΅ΡΡΠΎΠ²ΡΠΌΠΈ, ΠΌΡ ΠΏΡΠ΅Π΄Π»Π°Π³Π°Π΅ΠΌ ΠΈΠ½Π΄ΠΈΠ²ΠΈΠ΄ΡΠ°Π»ΡΠ½ΡΠΉ ΠΏΠΎΠ΄Ρ ΠΎΠ΄ ΠΊ ΠΊΠ°ΠΆΠ΄ΠΎΠΌΡ ΠΊΠ»ΠΈΠ΅Π½ΡΡ.
ΠΡ ΠΏΡΠ΅Π΄Π»Π°Π³Π°Π΅ΠΌ ΡΠΈΡΠΎΠΊΠΈΠΉ ΡΠΏΠ΅ΠΊΡΡ ΡΡΠ»ΡΠ³, Π²ΠΊΠ»ΡΡΠ°Ρ ΠΊΠΎΠ½ΡΡΠ»ΡΡΠ°ΡΠΈΠΈ ΠΏΠΎ Π³ΡΠ°ΠΆΠ΄Π°Π½ΡΠΊΠΈΠΌ ΠΈ ΡΠ³ΠΎΠ»ΠΎΠ²Π½ΡΠΌ Π΄Π΅Π»Π°ΠΌ. ΠΡ ΠΌΠΎΠΆΠ΅ΡΠ΅ ΠΎΠ±ΡΠ°ΡΠΈΡΡΡΡ ΠΊ Π½Π°ΠΌ ΠΏΠΎ Π²ΠΎΠΏΡΠΎΡΠ°ΠΌ, ΡΠ²ΡΠ·Π°Π½Π½ΡΠΌ Ρ ΡΡΡΠ΄ΠΎΠ²ΡΠΌ ΠΏΡΠ°Π²ΠΎΠΌ, ΡΠ΅ΠΌΠ΅ΠΉΠ½ΡΠΌΠΈ Π΄Π΅Π»Π°ΠΌΠΈ ΠΈ Π΄ΡΡΠ³ΠΈΠΌΠΈ ΡΡΠΈΠ΄ΠΈΡΠ΅ΡΠΊΠΈΠΌΠΈ Π°ΡΠΏΠ΅ΠΊΡΠ°ΠΌΠΈ. ΠΡ ΠΏΠΎΠ½ΠΈΠΌΠ°Π΅ΠΌ, ΡΡΠΎ ΠΊΠ°ΠΆΠ΄Π°Ρ ΡΠΈΡΡΠ°ΡΠΈΡ ΡΡΠ΅Π±ΡΠ΅Ρ ΠΈΠ½Π΄ΠΈΠ²ΠΈΠ΄ΡΠ°Π»ΡΠ½ΠΎΠ³ΠΎ ΠΏΠΎΠ΄Ρ ΠΎΠ΄Π°, ΠΈ Π³ΠΎΡΠΎΠ²Ρ ΠΏΡΠ΅Π΄Π»ΠΎΠΆΠΈΡΡ ΠΎΠΏΡΠΈΠΌΠ°Π»ΡΠ½ΠΎΠ΅ ΡΠ΅ΡΠ΅Π½ΠΈΠ΅.
ΠΡ Π·Π°ΡΠ΅ΠΊΠΎΠΌΠ΅Π½Π΄ΠΎΠ²Π°Π»ΠΈ ΡΠ΅Π±Ρ ΠΊΠ°ΠΊ Π½Π°Π΄Π΅ΠΆΠ½ΡΠΉ ΠΏΠ°ΡΡΠ½Π΅Ρ Π² ΡΡΠ΅ΡΠ΅ ΡΡΠΈΡΠΏΡΡΠ΄Π΅Π½ΡΠΈΠΈ. ΠΠ»ΠΈΠ΅Π½ΡΡ Π²ΡΠ±ΠΈΡΠ°ΡΡ Π½Π°Ρ Π·Π° ΠΏΡΠΎΡΠ΅ΡΡΠΈΠΎΠ½Π°Π»ΠΈΠ·ΠΌ Π·Π° Π²ΡΡΠΎΠΊΠΎΠ΅ ΠΊΠ°ΡΠ΅ΡΡΠ²ΠΎ ΠΎΠ±ΡΠ»ΡΠΆΠΈΠ²Π°Π½ΠΈΡ ΠΈ ΡΠ΅Π·ΡΠ»ΡΡΠ°ΡΠΈΠ²Π½ΠΎΡΡΡ. ΠΠ°ΠΆΠ΄ΡΠΉ ΡΠΏΠ΅ΡΠΈΠ°Π»ΠΈΡΡ ΠΈΠΌΠ΅Π΅Ρ ΠΎΠΏΡΡ ΡΠ°Π±ΠΎΡΡ Π² ΡΠ°Π·Π»ΠΈΡΠ½ΡΡ ΠΎΠ±Π»Π°ΡΡΡΡ ΠΏΡΠ°Π²Π° ΠΈ Π³ΠΎΡΠΎΠ² ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠ°ΡΡ Π²Π°Ρ Π² Π»ΡΠ±ΠΎΠ΅ Π²ΡΠ΅ΠΌΡ.
ΠΠ΅ ΠΆΠ΄ΠΈΡΠ΅, ΠΏΠΎΠΊΠ° ΡΠΈΡΡΠ°ΡΠΈΡ ΡΡΡΠ³ΡΠ±ΠΈΡΡΡ , ΡΡΠΎΠ±Ρ ΠΏΠΎΠ»ΡΡΠΈΡΡ ΠΊΠ²Π°Π»ΠΈΡΠΈΡΠΈΡΠΎΠ²Π°Π½Π½ΡΡ ΡΡΠΈΠ΄ΠΈΡΠ΅ΡΠΊΡΡ ΠΏΠΎΠΌΠΎΡΡ. ΠΠ°ΡΠ° ΠΊΠΎΠΌΠ°Π½Π΄Π° Π±ΡΠ΄Π΅Ρ ΡΠ°Π΄Π° ΠΏΡΠΎΠΊΠΎΠ½ΡΡΠ»ΡΡΠΈΡΠΎΠ²Π°ΡΡ Π²Π°Ρ . ΠΠΎΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ΡΡ Π½Π°ΡΠΈΠΌΠΈ ΡΡΠ»ΡΠ³Π°ΠΌΠΈ Π½Π° yuridicheskaya-konsultaciya34.ru.
can augmentin make you tired And then the height of the hammer must be kept the same every time, I m afraid this is no one, right