How to make job list activate an Aleph service twice a month or once a month Yoel Kortick.

Slides:



Advertisements
Similar presentations
Debugging ACL Scripts.
Advertisements

CIS 240 Introduction to UNIX Instructor: Sue Sampson.
Processes and Job Control. Foreground and Background (1)  Unix is a multi-tasking operating system –some of these tasks are being done by other users.
Job_List: the Basics System Librarian, Make your Job easier with job_list Presented at NAAUG 2002 by Susan Marshall.
UNIX command line. In this module you will learn: What is the computer shell What is the command line interface (or Terminal) What is the filesystem tree.
MagicInfo Pro Scheduler Now that a template has been created from content imported into the Library, the user is ready to begin scheduling content to.
1 Day 18 Bash and the.files. 2 The.files ls shows you the files in your directory –Or at least most of them. –Some files are hidden. Try: ls –a –This.
How to make a custom service run the X service for renew on a group of patrons Yoel Kortick.
How to sort the “Order Information report” from the service “Print Acquisitions Records acq-03” Yoel Kortick.
How to create a prompt in an Alma Analytics report Yoel Kortick | Senior Librarian.
How to Open a New Language in Web OPAC for Testing Web Screens Presenter: Yoel Kortick.
1 Audible Alert for Return Item on Hold rep_ver in V20 Yoel Kortick Aleph Support Manager.
V. 21. Automatic LKR field creation from item. Rep_ver and Yoel Kortick Aleph Support Manager.
If condition1 then statements elif condition2 more statements […] else even more statements fi.
Group, group, group One after the other: cmd1 ; cmd2 One or both: cmd1 && cmd2 Only one of them: cmd1 || cmd2 Cuddling (there):( cmd1 ; cmd2 ) Cuddling.
V. 21. Controlling and limiting the creation of photocopy and hold requests according to “service hours”. Rep_Ver Yoel Kortick.
How to add additional privileges to user_function.lng (originally SI ) Presenter: Yoel Kortick.
1 Controlling directionality with Unicode Characters Yoel Kortick Aleph Support manager.
1 Yoel Kortick Senior Librarian Alma Product Management How to create a scheduled report from an Alma Analytics report to be sent to Alma and non- Alma.
Full text indexing of multi character PDF documents as ADAM digital objects. V18 RC 2089 This presentation applies to Version 18 and up Presenter: Yoel.
Performing ISO ILL borrowing and lending requests on the same server Yoel Kortick 2008.
How to send Serial claims to vendor (Batch) Version 16 Yoel Kortick.
1 Designing and using normalization rules Yoel Kortick Senior Librarian, Ex Libris.
Setting up and using Acquisitions-related indexes and logical bases. Version 18 and up Yoel Kortick.
Aleph Publishing services with a special focus on PRIMO-FULL and PRIMO-AVAIL version 18 Presenter: Yoel Kortick.
Using home made fix procedures for non Latin characters Yoel Kortick.
Merge Rules and Routines
How to make a home made custom service Version 19 and up
Booking Requests ALEPH 500 Version 18
Yoel Kortick Senior Librarian
Yoel Kortick Senior Librarian
Scheduling Reports in BOXI 4.2
SMS Messaging in Aleph 500 Version 20 and up
How to use the job list Version Yoel Kortick.
How to separate semicolon delimited values to separate columns
How to send to the vendor an analytics report of items which have or have not arrived (Legal Deposit) Yoel Kortick Senior Librarian.
Presenter: Yoel Kortick
Development Environment Basics
How to print barcodes in batch mode via item-03
Presenter: Yoel Kortick
Version 20 Feature Developments
Aleph 500 Circulation In-House use
Overview of Acquisition Claiming in Alma
Digital Assets Module Services adam-01 and adam-02 versions 17 and up
Yoel Kortick Senior Librarian
How to Define Separate Order Counters for Separate Sub-Libraries
Prediction Patterns and Serial Check-in
Publishing Course Readings to PRIMO Version 20
e~Print - Innovative Ways We Use It
ReturnLoadPatron RC 2024 in V20
Introduction This presentation will show two ways of making a report of newly acquired records: Via services Retrieve Catalog Records (ret-01) and Print.
Interoperability Between Aleph and Primo: Aleph Restful APIs
Importing Serial Prediction Patterns Via the Service Import 85X records (Serial-52) Yoel Kortick.
Yoel Kortick Senior Librarian Alma Product Management
Presenter: Yoel Kortick
Parallel_words in versions 18, 19 and 20
How to… Use Crontab for SFX
Like tron and not kron, or chron
Report Creation Marie SHAH 31/01/2017.
Type the name of your first concept here
Yoel Kortick Senior Librarian
Automating SAS through the Power of VB Script
Scripts In Matlab.
Evaluations and Trials in Alma
Title of presentation Subtitle Name, job title DD Month YEAR.
New “replace string” parameter for fix_doc_do_file_08
Year 2 Spring Term Week 11 Lesson 1
Title of presentation Subtitle Name, job title DD Month YEAR.
How to use SDI Version 16 Yoel Kortick.
Presentation transcript:

How to make job list activate an Aleph service twice a month or once a month Yoel Kortick

Introduction The Aleph job_list from $alephe_tab is designed to work on a weekly basis. It is possible to have the job_list activate a secondary script which will then run the job on either a “every other week” or “once a month“ basis. There are many ways to do this, and here we will show only one way for each frequency.

Run the job and get parameters The first step is to run the desired Aleph service once from GUI and then get desired parameters from $alephe_scratch log file Here we run ret-03

Run the job and get parameters Here we get the parameters of the job ret-03 il-aleph02-19(4) USM50-YOELK>>cd $alephe_scratch il-aleph02-19(4) USM50-YOELK>>grep ^start usm01_p_ret_03.00033 start USM01,wti_library,wti=library, Here we make a simple script which includes a line to run the job (we will soon edit this script) il-aleph02-19(4) USM50-YOELK>>cat /exlibris/users/yoelk/aleph_op_p_ret_03_main csh -f $aleph_proc/p_ret_03 USM01,wti_library,wti=library, > $alephe_scratch/p_ret_03.log.`date '+%Y%m%d.%H%M%S'`

Twice a month - Make variable Now we will make a second script which will contain a variable which will start as “Y” but, as we will see, change back and forth between Y and N every time the job is run. Here is the starting situation of the script. il-aleph02-19(4) USM30-YOELK>>cat /exlibris/users/yoelk/aleph_op_p_ret_03_variable set ran_previous_time = Y If source is done on this file then a parameter will be created “ran_previous_time”

Run the job depending on variable Now we will edit the first script as follows: If the variable “ran_previous_time” = Y then the job will not run, and will change the file “aleph_op_p_ret_03_variable” so that next time “aleph_op_p_ret_03_main” is run the variable will be “N” If the variable “ran_previous_time” = N then the job will run, and will change the file “aleph_op_p_ret_03_variable” so that next time “aleph_op_p_ret_03_main” is run the variable will be “Y”

Run the job depending on variable il-aleph02-19(4) USM30-YOELK>>cat /exlibris/users/yoelk/aleph_op_p_ret_03_main source /exlibris/users/yoelk/aleph_op_p_ret_03_variable if ($ran_previous_time == "Y") then echo "ran_previous_time" is $ran_previous_time echo "job not running because it ran last time" perl -pi -e 's/Y/N/' /exlibris/users/yoelk/aleph_op_p_ret_03_variable endif if ($ran_previous_time == "N") then echo "job running because it did not run last time" csh -f $aleph_proc/p_ret_03 USM01,wti_library,wti=library, > $alephe_scratch/p_ret_03.log.`date '+%Y%m%d.%H%M%S'` perl -pi -e 's/N/Y/' /exlibris/users/yoelk/aleph_op_p_ret_03_variable

Testing the script Now if we run the script then the first time it should not run p_ret_03 and the second time it should run p_ret_03 the third time it should not run p_ret_03 and the fourth time it should run p_ret_03 This will continue indefinitely

Testing the script Did not run Did run Did not run Did run il-aleph02-19(4) USM30-YOELK>>csh -f /exlibris/users/yoelk/aleph_op_p_ret_03_main ran_previous_time is Y job not running because it ran last time il-aleph02-19(4) USM30-YOELK>> ran_previous_time is N job running because it did not run last time Did not run Did run Did not run Did run

Adding the script to job_list Now all that is left to do is add the script to $alephe_tab/job_list for once a week. One week the script will run the ret_03 and the next week it will not. ! 2 3 4 5 6 7 !!-!!!!!!!!-!-!!!!!!!!!!!!!!!!!!!!-!!!!!-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-!!!!!! 00 06:00:00 N ret_03.log csh -f /exlibris/users/yoelk/aleph_op_p_ret_03_main

Script for once a month Now we will make a script which will run p_ret_03 once a month, on a particular date every month The script will first check the date of the month and If it is a particular predefined date then ret_03 will run. If it is not a particular predefined date then ret_03 will not run.

Script for once a month There are many date options in UNIX The command man date will show them all We will use date '+%d' which shows the numeric date of the month il-aleph02-19(4) USM30-YOELK>>date '+%d' 13

Script for once a month Here is the script as set to run only if the date is the 04th of the month: il-aleph02-19(4) USM30-YOELK>>cat /exlibris/users/yoelk/aleph_op_p_ret_03_once_a_month set day_of_month = "`date '+%d'`" if ($day_of_month == "04") then echo "Today's date is" $day_of_month echo "p_ret_03 will run" csh -f $aleph_proc/p_ret_03 USM01,wti_library,wti=library, > $alephe_scratch/p_ret_03.log.`date '+%Y%m%d.%H%M%S'` else echo "Today is not the 04th of the month, p_ret_03 will not run" endif When date is 04 script will run When date is not 04 script will not run

Script for once a month Here is what happens when the date is not the 04th of the month: il-aleph02-19(4) USM30-YOELK>>csh -f /exlibris/users/yoelk/aleph_op_p_ret_03_once_a_month Today's date is 13 Today is not the 04th of the month, p_ret_03 will not run Here is what happens when the date is the 04th of the month: il-aleph02-19(4) USM30-YOELK>>csh -f /exlibris/users/yoelk/aleph_op_p_ret_03_once_a_month Today's date is 04 p_ret_03 will run il-aleph02-19(4) USM30-YOELK>> il-aleph02-19(4) USM30-YOELK>>cd $alephe_scratch il-aleph02-19(4) USM30-YOELK>>ls -lrt | tail -1 -rw-rw-r-- 1 aleph exlibris 3874 Jan 04 13:02 p_ret_03.log.20080104.130229

Script for once a month Now all we have to do is add this to job list to run every day. When it is the fourth of the month is will activate ret_03, and when it is not the fourth of the month it will not activate ret_03. ! 2 3 4 5 6 7 !!-!!!!!!!!-!-!!!!!!!!!!!!!!!!!!!!-!!!!!-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-!!!!!! W3 06:00:00 N ret_03_month.log csh -f /exlibris/users/yoelk/aleph_op_p_ret_03_once_a_month

Yoel.kortick@exlibris.co.il