crontab's Examples

this command submits, edits, lists or removes cron jobs. 

min hour dom mon dow cmd

to edit the crontab entry

$ crontab -e

to list all scheduled job of a particular user

crontab -u pavani -l

remove cronntab entries

crontab -r

it run the myscript.sh everyday at 8pm

08 20 myscript.sh

it runs the myscript.sh yearly

@yearly myscript.sh

it runs two scripts daily 6am

06 00 myscript.h myscriprt2.sh

run the specified task at the sysstem reboot

@reboot myscript.sh

we can see the current looged in user

crontab -l

-i option with -r is used to get the y/n response before removing the crontab

crontab -i -r

DevOpsSchool
Typically replies within an hour

DevOpsSchool
Hi there 👋

How can I help you?
×
Chat with Us