1.

Define cron job and steps to configure a cron job to run every week “At 00:00 on Sunday.”?

Answer»

cron Job is similar to Task Scheduler in WINDOWS. corn is a software utility which schedules a command or script on your SERVER to run automatically at a mentioned time and date. cron jobs can be very useful to automate repetitive tasks according to our need.

For example, we need to delete some temporary files every week to conserve our disk space. Once we have a script in place doing required action, We can set up a cron job to perform a certain action on a specific time. Scripts executed as a cron job are typically used to modify files, directories or databases. However, they can perform other tasks that do not modify data on the server, like sending email notifications.

We need to enter below LINES in crobtab by:

 testmachine@myworld-linux:~$ crontab -e

0 0 * * 0 /path/to/command

Where,

  • 1 => is the Minute (0-59)
  • 2 => is the Hours (0-23)
  • 3 => is the Day (0-31)
  • 4 => is the Month (0-12 [1 == January])
  • 5 => is the Day of the week(0-7 [7 or 0 == sunday])
  • /path/to/command – Script or command NAME want to schedule


Discussion

No Comment Found