Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

cron job

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

cron job

# ┌───────── 0-59 Minute        # NOTES: Escape %s in command like \%
# │ ┌─────── 0-23 Hour          # Blackhole Output: stdout: >/dev/null
# │ │ ┌───── 1-31 Day of Month  # Blackhole Output: stderr: 2>/dev/null
# │ │ │ ┌─── 1-12 Month         # Blackhole Output:   Both: 2>&1 >/dev/null
# │ │ │ │ ┌─ 0-6  Sun-Sat       ################################################
# * * * * * command
## EXAMPLES ####################################################################
 1  *  *  *  * echo "Runs hourly at first minute" >/dev/null
30 23  *  *  * echo "Runs daily at 23:30 (11:30 PM)" >/dev/null
 0  0  1  *  * echo "Runs monthly on day 1 at midnight" >/dev/null
45 12  *  2  * echo "Runs at 12:45 everyday during Month:2 (Feb)" >/dev/null
15  0  *  *  6 echo "Runs at 00:15 on 6th weekday (Sat)" >/dev/null
Comment

cron job

cronjobs
Comment

PREVIOUS NEXT
Code Example
Shell :: git use cat instead of less 
Shell :: Deleting all the git local branches 
Shell :: rdp github shadow 
Shell :: wp cli tagline 
Shell :: ubuntu delete folder 
Shell :: rename branch in git 
Shell :: sed delete line before match 
Shell :: stop linux service 
Shell :: how to make top bar transparent ubuntu 
Shell :: mkdir creating multiple containing folders 
Shell :: install robot framework 
Shell :: view process in linux 
Shell :: linux how to write to file 
Shell :: copy everything vim 
Shell :: download fbreader for ubuntu 
Shell :: install watchman on linux 
Shell :: How to use my windows file through bash 
Shell :: git move file 
Shell :: os installation date 
Shell :: uninstall yarn 
Shell :: git set up 
Shell :: tasksel uninstall package 
Shell :: flutter pub get taking too long 
Shell :: Install JDK on Rocky Linux 8 
Shell :: create vue app locally 
Shell :: xargs parameter 
Shell :: clone a repository 
Shell :: search for a filetype extension PowerShell 
Shell :: delete lines that contain a pattern in unix 
Shell :: git graph command 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =