Monday, August 25, 2008

Cron in Linux

  • Check Cron whether installed in linux: rpm -qa | grep cron
  • Start cron service in RHEL, service crond start
  • Edit tasks: crontab -e, the task configure structure is
    [Minute] [Hour] [Day of the month] [Month of the year] [Day of the week] [command]
    "*" represent any number. "/" means every. "-" means to. "," separate more than one value eg: */2 2-4 2,5,7 * * means every 2 mins between 2 o'clock and 4 o'clock in the second, fifth and seventh day in each month.
  • Del tasks: crontab -r
  • List tasks: crontab -l

No comments: