Setting Crontab

The tibcocrontab.sh sample script is in $MQ_HOME/bin. Use the script to create crontab entries required for a periodic cleanup of temporary files. The temporary files are generated in the $MQ_COMMON_DIR/Work and $MQ_COMMON_DIR/Temp directories.

You can modify the tibcocrontab.sh file to change the frequency and retention policy and to fit within your IT policies. If your IT policy does not allow a cron job to be setup, you can use any schedule. You can run this script manually or using any job scheduler.

If you are defining crontab entries, ensure the crontab is defined for a user that owns the TIBCO MDM Application.

Prerequisite

For Linux or Unix installations, you must set $MQ_HOME and $MQ_COMMON_DIR in tibcocrontab.sh.

Procedure

  1. At the Unix Shell prompt, enter:
    $crontab -e
  2. Set $MQ_LOG environment variable by adding the following line: LOG_FILE=$MQ_HOME/log/velocrontab.log
  3. Edit the file to add the following line:
    1 0 */30 * * sh /opt/tibco/mdm/version/bin/tibcocrontab.sh >> /opt/tibco/mdm/version/log/tibcocrontab.log 2>&1

    indicates you to run the /opt/tibco/mdm/version/bin/tibcocrontab.sh shell script with the sh shell at 00:01 every 30 days, appending (adding) the standard and error output to the /opt/tibco/mdm/version/log/tibcocrontab.log file.

    0 1 */1 * * find MQ_COMMON_DIR/Work -type d -empty -mmin +23 -print0 | xargs -0 rm -rf;

    indicates you to execute the find command on the $MQ_COMMON_DIR/Work directory. The command produces a empty sub-directories list in the $MQ_COMMON_DIR/Work that is at least 23 hours old. Piping that list (with a null terminator to accurately capture directory names with spaces and other non-standard characters) to the xargs command, so that it can build and execute the rm -rf <directory list> command (the most efficient way to remove empty sub-directories).

  4. Save and exit.

    :wq!

  5. Edit the RETENSION_POLICY variable in this script to specify the retention policy. RETENSION_POLICY_DAYS=numberofdays
  6. To check any crontab setting, run the following command:

    $crontab –l