Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

syntax crontab

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  *  user command to be executed
example :
# 50 12 * * * ----- run every day at 12.50

# */5 * * * * ----- run every 5 minutes
Comment

crontab example

crontab -e						# to edit (then 'i': insert, ':wq!': save and quit)
10 * * * * /bin/sh backup.sh    # every hour at 10"
0 */4 * * * /bin/sh backup.sh   # every 4 hours at 0"
0 9-17 * * * /bin/sh backup.sh  # every hour at 0" between 9 and 17
0 2 * * * /bin/sh backup.sh     # daily at 2am
0 0 * * MON /bin/sh backup.sh   # every Monday at 0am
0 0 * * 1-5 /bin/sh backup.sh   # daily from Monday to Friday at 0am
0 0 * * 0 /bin/sh backup.sh     # weekly on Sunday
0 0 1 * * /bin/sh backup.sh     # monthly (1rst day at 0am)
0 0 1 */3 * /bin/sh backup.sh   # every quarter (1rst day at 0am)
0 0 1 1 * /bin/sh backup.sh     # yearly (01/01)
Comment

crontab sample command

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- weekday (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  *  user command to be executed
10 * * * * /bin/sh backup.sh    # every hour at 10"
Comment

crontab syntax

.---------------- minute (0 - 59) 
|  .------------- hour (0 - 23)
|  |  .---------- day of month (1 - 31)
|  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ... 
|  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7)  OR sun,mon,tue,wed,thu,fri,sat 
|  |  |  |  |
*  *  *  *  *  command to be executed
Comment

PREVIOUS NEXT
Code Example
Shell :: django upgrade 
Shell :: ubuntu monitor io 
Shell :: wsl2 ubuntu xfce 
Shell :: wordpress set tagline from cli 
Shell :: git clone different ssh key 
Shell :: bash create symbolic link to other symbolic links 
Shell :: To install Scrapy on Ubuntu (or Ubuntu-based) systems 
Shell :: how to make new branch and switch in git 
Shell :: git push empty directories 
Shell :: chmod recursive group read 
Shell :: install kubebuilder in macbook pro 
Shell :: stack navigator 
Shell :: Sending a Simple Email From Linux Terminal 
Shell :: Everything up-to-date git push origin main 
Shell :: Pull Ubuntu image 
Shell :: git --version git version 2.7.0 (Apple Git-66) 
Shell :: git hard reset origin 
Shell :: linux list users 
Shell :: github bullet points 
Shell :: Help manual in linux 
Shell :: -eq shell script 
Shell :: perl install Switch 
Shell :: bash execute command in variable 
Shell :: running file pug 
Shell :: install python 3.6 in colab 
Shell :: how to install velero on ubuntu 
Shell :: untar ubuntu 
Shell :: how to autostart containers in ubuntu 
Shell :: update hour linux 
Shell :: git view last commits 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =