Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to start cron job

#Red Hat / CentOs:

service crond start

#or

/etc/init.d/crond start

#Ubuntu:

sudo service cron start

#or

sudo /etc/init.d/cron start
Comment

create cron job from command line

#write out current crontab
crontab -l > mycron
#echo new cron into cron file
echo "00 09 * * 1-5 echo hello" >> mycron
#install new cron file
crontab mycron
rm mycron
Comment

setup cron job

# to list all crontab content (including scheduled jobs)
crontab -l

# to edit crontab file
crontab -e

# once you have finished adding tasks, save the file and exit
# the cron daemon will read and execute the instructions provided
Comment

How CRON jobs works

# Use the hash sign to prefix a comment
# +---------------- minute (0 - 59)
# |  +------------- hour (0 - 23)
# |  |  +---------- day of month (1 - 31)
# |  |  |  +------- month (1 - 12)
# |  |  |  |  +---- day of week (0 - 7) (Sunday=0 or 7)
# |  |  |  |  |
# *  *  *  *  *  command to be executed
#-----------------------------------------------------------

Comment

PREVIOUS NEXT
Code Example
Shell :: git move file 
Shell :: linux ubuntu how to install AppIndicator 
Shell :: Encountered error while trying to install package. psycopg2 
Shell :: removing portion of history from terminal mac 
Shell :: windows command cmd date 
Shell :: aternative wget comand 
Shell :: how to add text to promt in linux 
Shell :: vi search 
Shell :: docker swarm get nodes 
Shell :: use mock api 
Shell :: linux history delete line 
Shell :: oh-my-posh autosuggestions 
Shell :: how to install pandas 
Shell :: redis mac 
Shell :: install newman-reporter-htmlextra 
Shell :: how to rename a file in linux 
Shell :: grep count words 
Shell :: apply stash git 
Shell :: docker save to file 
Shell :: syntax error: unexpected end of file bash 
Shell :: search for a filetype extension PowerShell 
Shell :: concatenate multiple zip files linux 
Shell :: internet not working on centos 8 on linux 
Shell :: how many number of lines in a file 
Shell :: speedtest cli install 
Shell :: randomstring npm 
Shell :: open cmd in current directory 
Shell :: shell iterate over lines in variable 
Shell :: delete from transfer.sh 
Shell :: git config --list 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =