AutoSys Workload Automation

Expand all | Collapse all

Scheduler (Automation DE series) - schedule purgecompletedjobs command

  • 1.  Scheduler (Automation DE series) - schedule purgecompletedjobs command

    Posted 06-06-2016 06:43 PM

    Hi Experts,

    I have a requirement to purge completed jobs. I was able to purge the completed jobs successfully by executing purgecompletedjobs command successfully on command line interface. Could you please let me know as to what is the best way (also steps) to schedule purgecompletedjobs command to purge completed jobs at a regular interval.

     

    Kind Regards,

    Sudhir Goel



  • 2.  Re: Scheduler (Automation DE series) - schedule purgecompletedjobs command

    Posted 06-07-2016 09:33 AM
      |   view attached

    The best way is to schedule the PURGECOMPLETEDJOBS cli command daily to purge all completed jobs that are older than a specified number of days.

     

    Please refer to the sample applications in Desktop Client 11.3.x or DE R12 with examples;

     

    https://docops.ca.com/ca-wla-de/11-3-3/en/administrating/maintaining/set-up-a-housekeeping-application

     

    https://docops.ca.com/ca-wla-de/12-0/en/administrating/maintaining/set-up-a-housekeeping-application

     

    Thank you!



  • 3.  Re: Scheduler (Automation DE series) - schedule purgecompletedjobs command

    Posted 06-08-2016 02:08 PM

    Hi Segun,

     

    I created another house keeping application by copying the house keeping utility application and executed it. Command deletestatusmessages threshold('%APPL.date') deleted the messages older than time period May 1st 2016 (Date and Time 2016-5-1 12:31:41). Is there a way to change the threshold to 7 days old date so that deletestatusmessages command deletes all the messages older than 7 days.

     

    Regards,

    Sudhir Goel



  • 4.  Re: Scheduler (Automation DE series) - schedule purgecompletedjobs command

    Posted 06-09-2016 09:44 AM

    Hi Sudhir,

     

    I believe you are missing the javascript that was part of the sample application which computes the value for APPL.date.  In the R12 sample application this script is defined in the job definition to be run at event trigger time.

     

    //Configure how many days older statuesmessages to delete

    var no_of_days = 7

    var old_date = new Date();

    old_date.setDate(old_date.getDate() - no_of_days);

    APPL.date = (old_date.getYear()+1900)+'-'+old_date.getMonth()+'-' +old_date.getDate()+' '+old_date.getHours()+':'+old_date.getMinutes()+':'+old_date.getSeconds();

     

    HTH,

    Pradeepan Gunabalasingam



  • 5.  Re: Scheduler (Automation DE series) - schedule purgecompletedjobs command

    Posted 06-10-2016 05:46 PM

    Hi Pradeepan,

     

    Thanks for your response. As per CA support, there is a bug in the java script. Support gave me below java script to replace with the existing one, and it worked as expected.

     

    //Configure how many days older statuesmessages to delete

    var no_of_days = 7

    var old_date = new Date();

    old_date.setDate(old_date.getDate() - no_of_days);

    var month = eval(old_date.getMonth() + 1)

    APPL.date = (old_date.getYear()+1900)+'-'+month+'-' +old_date.getDate()+' '+old_date.getHours()+':'+old_date.getMinutes()+':'+old_date.getSeconds()

     

    Regards,

    Sudhir Goel