1 / 5

Running the Operational Codes for the Brahmaputra

Learn how to use the CRON scheduler in Unix-like operating systems to automate job processing and system maintenance tasks. This tutorial explains how to create CRON jobs, schedule them at specific times, and remove them when needed.

briangsmith
Download Presentation

Running the Operational Codes for the Brahmaputra

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Running the Operational Codes for the Brahmaputra Tom Hopson

  2. Automatic (background) Job Processing: CRON Cron is a time-base job scheduler in Unix-like computer operating systems. 'cron' is short for 'chronograph’. Cron enables users to schedule jobs (commands or shell scripts) to run automatically at a certain time or date. It is commonly used to perform system maintenance or administration, though its general purpose nature means that it can be used for other purposes, such as connecting to the Internet and downloading email.

  3. Crontab file: .---------------- minute (0 - 59) | .------------- hour (0 - 23) | | .---------- day of month (1 - 31) | | | .------- month (1 - 12) OR jan,feb,mar,apr ... | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat | | | | | * * * * * command to be executed There are several special entries, most of which are just shortcuts, that can be used instead of specifying the full cron entry: Entry Description Equivalent To @reboot Run once, at startup. None @yearly Run once a year 0 0 1 1 * @annually (same as @yearly) 0 0 1 1 * @monthly Run once a month 0 0 1 * * @weekly Run once a week 0 0 * * 0 @daily Run once a day 0 0 * * * @midnight (same as @daily) 0 0 * * * @hourly Run once an hour 0 * * * * Note: you may need to specify full paths of programs since SHELL (“dot” files) are not used by CRON

  4. First steps using Linux commands: CRON file creation example: Go to the director: cd /home/hp/Desktop/CRONtalk Create a file called, say, “cron_ex”, with: * * * * * echo "trying this out!" >> /home/hp/Desktop/CRONtalk/cron_test Then type: >crontab cron_ex (to install the CRON job) >crontab -l (to see if it is working in the CRON environment >date (to make sure a minute has passed) After a minute in your directory, you should see a file “cron_test” >cat cron_test (to see the output) Then type >crontab -r (to remove)

More Related