Presentation is loading. Please wait.

Presentation is loading. Please wait.

How to… Use Crontab for SFX

Similar presentations


Presentation on theme: "How to… Use Crontab for SFX"— Presentation transcript:

1 How to… Use Crontab for SFX
Press the F11 key on your keyboard to maximize this window

2 What is a Crontab? Time-based job scheduler
Enables users to execute commands/scripts automatically at a specified time/date For use in Unix systems Also known as “cron” or “cronjob” So what is a Crontab? Crontab is a program that enables Unix users to execute commands or scripts, which are groups of commands, automatically at a specified date and time. It is normally used for system administration commands. You can access some links relating to Crontab, such as a defintion, some examples, and an additional online tutorial, via the Attachments button above.

3 SFX Uses Crontabs… For maintenance tasks To verify tasks will be run
For late night tasks So why – and when – would you as a SFX customer use a crontab? You can see the main reasons listed here… (CLICK) Using a crontab for late night tasks is ideal since it is automatic so you don’t have to be there when it runs. (CLICK) What we will do in the next few minutes is see how to edit a crontab, review the crontab structure, and see how to use the wildcard character when creating a crontab.

4 Crontab Command Structure
* * * * * [command] Day of week (0-6) (Sunday=0) Month (1-12) Day of month (1-31) Hour (0-23) Minute (0-59) This is the way the crontab command structure looks like (CLICK) each asterisk represents date and time parameters of the command, and [command] is where you would type the actual command. (CLICK) Here you can see the actual meaning of the fields, and what values you can assign to each field. For example, let’s say you want the command to run on Saturday night May 17, at exactly 11:59PM – what would you type for the command parameters?

5 Crontab Command Structure

6 Crontab Command Structure
* * * * * [command] Day of week (0-6) (Sunday=0) Month (1-12) Day of month (1-31) Hour (0-23) Minute (0-59) So this is what the command line would look like, (CLICK) if you wanted the command to run on (CLICK) Saturday night, (CLICK) at exactly 11:59PM, (CLICK) on May 17

7 Using the Wildcard (“*”)
Run EVERY Saturday at 11:59PM… * * * * * * * [command] * Day of week (0-6) (Sunday=0) Month (1-12) Day of month (1-31) Hour (0-23) Minute (0-59) OK, but what if we want to run the command EVERY Saturday (CLICK), not just on a SPECIFIC Saturday? This makes a lot of sense – having some kind of weekly job, and you don’t want to have to change the parameters every week! (CLICK) That’s where the wildcard – the “asterisk” comes into play (CLICK) There’s no NEED, to specify the day and month, so you would (CLICK) replace those two fields with an asterisk. Now, the command will run on every Saturday at 11:59PM.

8 Editing the Crontab Command
For both Sun & Linux systems “crontab –e” You can use the VI Editor to make changes to your crontab. (CLICK) For both Sun and Linux systems,, this is the command you type to edit the crontab.

9 30 3 * * 1-6 SFX Crontab Example 03:30
/exlibris/sfx_ver/sfx_version_3/[instance name]/admin/aztools_ver3/az_index_builder.cron /exlibris/sfx_ver/sfx_version_3/[instance name]/admin/aztools_ver3/az_index_builder.cron every day at 3:30 AM EXCEPT on Sundays 30 3 * * 1-6 /exlibris/sfx_ver/sfx_version_3/[instance name]/admin/aztools_ver3/az_index_builder.cron Let’s ay we want to run the following command (CLICK), : “/exlibris/sfx_ver/sfx_version_3/[instance name]/admin/aztools_ver3/az_index_builder.cron” which is for rebuilding the A-Z index, each day at 3:30 AM, except for Sunday: (CLICK) What would you insert into the cron? (Pause) (CLICK) This is what you would insert into the cron, (CLICK) Let’s take a closer look at the parameters we added in front of the actual command: (CLICK) The first two parameters represent the time 3:30 AM, the two asterisks are in place of the month and the day of the month since these are irrelevant, and the “1-6” represents Monday through Saturday – every day except Sunday Let’s see if you can answer a few questions.. 30 3 * * 1-6 Everyday except Sunday 03:30 Month & day in month - irrelevant

10 Crontab Examples

11 What is a Crontab? Time-based job scheduler
Enables users to execute commands/scripts automatically at a specified time/date For use in Unix systems Also known as “cron” or “cronjob” You should now know what is a crontab, and how to use it to run jobs automatically for SFX You can access some links relating to Crontab, such as a definition, some examples, and an additional online tutorial, via the Attachments button above.

12


Download ppt "How to… Use Crontab for SFX"

Similar presentations


Ads by Google