CRON JOB

 Credit to: Wikipedia
Credit to: Wikipedia (Cron)

Assalamualaikum wbt & hello, everyone! :)
We are Amoy, Adilah, Syukri and Yuvanes from Class NW4 (DDT4A) that are currently studying in Politeknik Mersing, Johor. In this post, we are going to describe and write about Cron Job which is in the third chapter in the subject Open Source Server Administration! Let's go :)

WHAT IS CRON JOB?
  • Cron job is a LINUX utility (daemon) which schedules a command or script on the server to run automatically at specific time or date. We must select our desired time, date or even day to schedule any task.
  • Not only that, cron job also can be used to delete temporary files at our own time interval to save or conserve space. There are many more benefits of cron job.
  • All cron job will be save inside cron tab or cron table, it is a configuration file that specifies every single thing that we want to make it scheduled. On our Ubuntu Server, we use command 'sudo nano /etc/crobntab' to open the configuration file.
TIME INTERVAL THAT CAN BE USE?
  • Minutes
  • Hours
  • Months
  • Date
  • Day of the week
  • Day of the month
3 COMPONENTS RELATED TO CRON JOB
  • Script
  • Command
  • Action / Output
HOW TO SET CRON JOB
We need to follow the format to ensure that our cron job is configured correctly and scheduled at the right time.

Credit to: Drupal.orgCredit to: Wikipedia (Cron)
  • For the first asterick (read: star sign) represents minute. Starting from 0 until 59.
  • Second asterick sign represents hour. Starting from 0 until 23.
  • Third asterick sign represents day of month. Starting from 1 (first day of month) until 31 (last day of month) & can be used to set date.
  • Forth asterick represents the month. Starting from 1 (January) until 12 (December).
  • Fifth asterick represents day of week. Starting from 0 (Sunday) until 7 (Saturday).

  • For every 1 minute, just set as '* * * * *'.
  • Every 15 minutes, set as '*/15 * * * *'.
  • For every 30 minutes, set as '*/30 * * * *'.
  • Every 1 hour, just set as '0 * * * *'.
  • For every 6 hours, just set as '0 */6 * * *'.
  • Every 12 hours, set as '0 */12 * * *'.
  • Next, for once a day, just set as '4 0 * * *'.
  • For every once a week, set at '4 0 * * 0'.
  • Lastly, for once a month, set as '4 0 1 * *'.

TERMS USED
  • Cron job ; a task
  • Cron tab ; a list of user's tasks
COMMAND USED FOR CRON JOB

  • crontab -l ; to see a listing of current user's cronjob
  • crontab -e ; to edit the crontab
  • crontab -r ; to remove current tab
CRON JOB PERMISSIONS
  • /etc/cron.allow - must contains our username to use cron job.
  • /etc/crom.deny - do not list the username to deny cron job.
That's all from us, hope that you will gain some benefits & knowledge from our post. Thank you! :)

REFERENCES
Made by:
  • Roha Adibah binti Mohd Shah 25DDT16F1035
  • Mohamad Syukri bin Mohamad Zalani 25DDT16F1023
  • Nur Adilah binti Mazlan 25DDT16F1057
  • Yuvanes a/l Gopal 25DDT16F1037

Comments

Popular Posts