Skip to main content
ExLibris
  • Subscribe by RSS
  • ExLibris Dev

    Crontab

    • Article Type: General
    • Product: Aleph
    • Product Version: 20

    Description:
    We have a number of scripts where we need to set appropriate environment variables by doing "dlib cur50".

    The entry in the crontab for this job is as follows: <BR> 30 6 * * 1,2,3,4,5 su - aleph -c /home/aleph/scripts/aleph_clear_hold.sh > /home/aleph/logs/aleph_clear_hold.log 2> /dev/null

    When this job is run via the crontab, it runs in the Production (20_1) environment. (Because it's a batch job, we are unable to enter "1" or "2" to indicate Production or Training but we have demonstrated that in such cases, the job runs in the Production environment.)

    Using crontab, how would we run home/aleph/scripts/aleph_clear_hold.sh in the Training environment?
    Having separate Production and Training versions of the job would be an acceptable solution but what would the Training version of this job look like?

    Resolution:
    Please note that Ex Libris support in general is not responsible for any scripts created by customers outside the standard Aleph routines.

    But we may help with some hints:

    Each script run from cron should start with the activation of the relevant environment, for example (Aleph 20):

    #!/bin/csh -f
    source /exlibris/aleph/u20_1/alephe/aleph_start

    Important notes:
    1. Use HARD CODED PATH to aleph_start- not environment variable.
    2. In case the same script needs to be activated in two different copies (a20_1 and a20_2), two examples of scripts should be created - one for every environment, with activation of relevant aleph_start

    If additional aliases/definitions are used (for example dlib command used), .cshrc should also be activated:

    #!/bin/csh -f
    source /exlibris/aleph/a20_1/alephm/.cshrc

    Please change the relevant scripts and re-check the issue.

    Additional Information

    crontab, scripts, PATH to aleph_start


    • Article last edited: 10/8/2013
    //doorbell.io feedback widged