![]() Day of the Week: It takes value from 0 to 6.Hour: Hour at which the command is to be executed.Minute: Minute at which the command is to be executed.Syntax: (Minute) (Hour) (Date) (Month) (Day of Week) (Command) Go at last of the Crontab and specify the command to be executed in following syntax: Where -e tag is used to open the crontab in edit mode.Ĭrontab scheduler gives three ways to modify itself. Open Crontab for root user using the following command: # crontab -e ![]() Note: Crontab Schedulers perform their task at specified schedule given the machine is on power at that time. Here, Crontab Scheduler is used to automatically take backup of specified folder using backup.sh shell script every day at 12 O'Clock in the afternoon. Scheduling Shell Scripts using Crontab SchedulerĬrontab Scheduler is inbuilt tool in Linux that automatically executes defined task at specified schedule. Syntax: tar -cvf / fetches all the matching files of find command and serves input to rm command one by one.ĥ. Tar -cvf /backupfolder/backup.tar /home/nishkarshraj/Desktop/Automation-using-Shell-Scripts The backup.sh file is created and it is highlighted in green color meaning it has executable permissions. Provide executable permission to the Shell Script # chmod +x
0 Comments
Leave a Reply. |