12 Replies Latest reply: Oct 23, 2012 7:23 PM by Bill Robinson RSS

Old Jobs Deletion Task.

Shirish Katariya

Dear All,

                    I want to know that how can i delete old jobs in a bunch from Jobs folder rather than delete them one by one.

 

Thanks,

Shirish Jain.

  • 1. Old Jobs Deletion Task.
    Prabhat Handoo

    You can set the RESULT_RETENTION property and you enable the retention policy enforcement in blasadmin.  then run the Delete executeRetentionPolicy command... that will remove Job Runs.

     

    See this: https://communities.bmc.com/communities/message/243033#243033

  • 2. Old Jobs Deletion Task.
    Shirish Katariya

    Hi Prabhat,

                           I have set the RESULT_RETENTION property and ran that command by which the job data from database is cleaned. but the jobs are still available in GUI. i want to delete these jobs from GUI. so how could i proceed further???

     

    Thanks,

    Shirish.

  • 3. Old Jobs Deletion Task.
    Bill Robinson

    Prabhat - the RESULT_RETENTION property will only delete old job runs, not the actual jobs.  There are a couple ways you can do this:

     

    create a smart group that contains all of your old jobs - use criteria like 'DATE_CREATED greater than 100 days' or something like that.

     

    1 - run some blcli commands to do the deletion:

    blcli_execute SmartJobGroup groupNameToId "/some/job/smartgroup"
    blcli_storeenv jobGroupId
    blcli_execute Job findAllHeadersByGroup ${jobGroupId}
    blcli_execute Utility storeTargetObject jobHeaders
    blcli_execute Utility listLength
    blcli_storeenv listLength

    echo ${listLength}
    for item in {0..$((${listLength}-1))}
            do
            blcli_execute Utility setTargetObject jobHeaders
            blcli_execute Utility listItemSelect ${item}
            blcli_execute Utility setTargetObject
            blcli_execute SJobHeader getDBKey
            blcli_storeenv jobKey
            blcli_execute SJobHeader getObjectTypeId
            blcli_storeenv jobTypeId
            blcli_execute Delete deleteModelObjectAndDependentObjects ${jobTypeId} $
    {jobKey}
    done

     

    2 on the smart group right click and run 'set server property' and set the AUTO_GENERATED property to 'true'.

    in blasadmin make sure you have the 'autogeneratedretentiontime' set to some number - like 30 or 90 - however many days worth of jobs you want to keep.  then run the blcli cleanup commands:  executeRetentionPolicy, cleanupDatabase, cleanupFileServer

  • 4. Old Jobs Deletion Task.
    Shirish Katariya

    Hii Bill,

                    As you have given the script, i have tried executing as Job type 1 and job type2. however i get the below logs. could you please help?

     

    Started running  the job 'Del' on application server 'SERVER'(2,000,000)
    Executing work item NSH Script Job:Del;  Server:IP ADDRESS;  on application  server: SERVER
    2059002[com.bladelogic.model.base.header.SJobHeaderImpl@52a19b,  com.bladelogic.model.base.header.SJobHeaderImpl@efea28,  com.bladelogic.model.base.header.SJobHeaderImpl@f5eeba,  com.bladelogic.model.base.header.SJobHeaderImpl@c23fd,  com.bladelogic.model.base.header.SJobHeaderImpl@10edbff,  com.bladelogic.model.base.header.SJobHeaderImpl@8d4d26,  com.bladelogic.model.base.header.SJobHeaderImpl@c3fb19,  com.bladelogic.model.base.header.SJobHeaderImpl@9a2bd4,  com.bladelogic.model.base.header.SJobHeaderImpl@1b39089,  com.bladelogic.model.base.header.SJobHeaderImpl@1d6133e,  com.bladelogic.model.base.header.SJobHeaderImpl@1896608,  com.bladelogic.model.base.header.SJobHeaderImpl@189ad8c,  com.bladelogic.model.base.header.SJobHeaderImpl@1e0e80b,  com.bladelogic.model.base.header.SJobHeaderImpl@a26288,  com.bladelogic.model.base.header.SJobHeaderImpl@f2f3f9,  com.bladelogic.model.base.header.SJobHeaderImpl@6f6f48,  com.bladelogic.model.base.header.SJobHeaderImpl@1f2e96c,  com.bladelogic.model.base.header.SJobHeaderImpl@badb7c,  com.bladelogic.model.base.header.SJobHeaderImpl@19fbbb4,  com.bladelogic.model.base.header.SJobHeaderImpl@1dc3390,  com.bladelogic.model.base.header.SJobHeaderImpl@1bd56c4,  com.bladelogic.model.base.header.SJobHeaderImpl@18b9d53, com.bladelogic.model.base.header.SJobHeaderImpl@105dae4,  com.bladelogic.model.base.header.SJobHeaderImpl@165cd01,  com.bladelogic.model.base.header.SJobHeaderImpl@763cf8,  com.bladelogic.model.base.header.SJobHeaderImpl@9cd182,  com.bladelogic.model.base.header.SJobHeaderImpl@17ebc7a,  com.bladelogic.model.base.header.SJobHeaderImpl@1882ced,  com.bladelogic.model.base.header.SJobHeaderImpl@13d9b2a,  com.bladelogic.model.base.header.SJobHeaderImpl@195febb,  com.bladelogic.model.base.header.SJobHeaderImpl@86be5e, com.bladelogic.model.base.header.SJobHeaderImpl@3c37a6,  com.bladelogic.model.base.header.SJobHeaderImpl@1697990,  com.bladelogic.model.base.header.SJobHeaderImpl@1ac008a,  com.bladelogic.model.base.header.SJobHeaderImpl@1576c0f,  com.bladelogic.model.base.header.SJobHeaderImpl@7780c3,  com.bladelogic.model.base.header.SJobHeaderImpl@1a6aa74,  com.bladelogic.model.base.header.SJobHeaderImpl@100a998,  com.bladelogic.model.base.header.SJobHeaderImpl@7e62ad,  com.bladelogic.model.base.header.SJobHeaderImpl@18066c7, com.bladelogic.model.base.header.SJobHeaderImpl@dbbeab,  com.bladelogic.model.base.header.SJobHeaderImpl@c2fe3a,  com.bladelogic.model.base.header.SJobHeaderImpl@1c0d0cd,  com.bladelogic.model.base.header.SJobHeaderImpl@1cc4ee9,  com.bladelogic.model.base.header.SJobHeaderImpl@50de63,  com.bladelogic.model.base.header.SJobHeaderImpl@1386c1c,  com.bladelogic.model.base.header.SJobHeaderImpl@141d528,  com.bladelogic.model.base.header.SJobHeaderImpl@1113be4,  com.bladelogic.model.base.header.SJobHeaderImpl@732578, com.bladelogic.model.base.header.SJobHeaderImpl@1a0f4cb,  com.bladelogic.model.base.header.SJobHeaderImpl@276d80,  com.bladelogic.model.base.header.SJobHeaderImpl@85f5c2,  com.bladelogic.model.base.header.SJobHeaderImpl@c9b39f,  com.bladelogic.model.base.header.SJobHeaderImpl@2fb31b,  com.bladelogic.model.base.header.SJobHeaderImpl@197d9b7,  com.bladelogic.model.base.header.SJobHeaderImpl@568c8e,  com.bladelogic.model.base.header.SJobHeaderImpl@25edfe,  com.bladelogic.model.base.header.SJobHeaderImpl@2bda77, com.bladelogic.model.base.header.SJobHeaderImpl@113f636,  com.bladelogic.model.base.header.SJobHeaderImpl@1898a25,  com.bladelogic.model.base.header.SJobHeaderImpl@ccba4b,  com.bladelogic.model.base.header.SJobHeaderImpl@da9b91,  com.bladelogic.model.base.header.SJobHeaderImpl@1b6cd4,  com.bladelogic.model.base.header.SJobHeaderImpl@85d360,  com.bladelogic.model.base.header.SJobHeaderImpl@1f87000,  com.bladelogic.model.base.header.SJobHeaderImpl@1814761,  com.bladelogic.model.base.header.SJobHeaderImpl@753313, com.bladelogic.model.base.header.SJobHeaderImpl@6c32fd,  com.bladelogic.model.base.header.SJobHeaderImpl@187aa51,  com.bladelogic.model.base.header.SJobHeaderImpl@1becb66,  com.bladelogic.model.base.header.SJobHeaderImpl@11ba0b1,  com.bladelogic.model.base.header.SJobHeaderImpl@d2d572,  com.bladelogic.model.base.header.SJobHeaderImpl@1bb3e26,  com.bladelogic.model.base.header.SJobHeaderImpl@1ed5cc2,  com.bladelogic.model.base.header.SJobHeaderImpl@650211,  com.bladelogic.model.base.header.SJobHeaderImpl@16aaa4a, com.bladelogic.model.base.header.SJobHeaderImpl@1d21551,  com.bladelogic.model.base.header.SJobHeaderImpl@1757ee7,  com.bladelogic.model.base.header.SJobHeaderImpl@de7698,  com.bladelogic.model.base.header.SJobHeaderImpl@13c03f6,  com.bladelogic.model.base.header.SJobHeaderImpl@1283524,  com.bladelogic.model.base.header.SJobHeaderImpl@b8ecd3,  com.bladelogic.model.base.header.SJobHeaderImpl@c437ff,  com.bladelogic.model.base.header.SJobHeaderImpl@3846bd,  com.bladelogic.model.base.header.SJobHeaderImpl@ac4c76, com.bladelogic.model.base.header.SJobHeaderImpl@1d00eb7,  com.bladelogic.model.base.header.SJobHeaderImpl@7622bf,  com.bladelogic.model.base.header.SJobHeaderImpl@1e34274,  com.bladelogic.model.base.header.SJobHeaderImpl@11fdbf9,  com.bladelogic.model.base.header.SJobHeaderImpl@a2ec4d,  com.bladelogic.model.base.header.SJobHeaderImpl@47babc,  com.bladelogic.model.base.header.SJobHeaderImpl@134c327,  com.bladelogic.model.base.header.SJobHeaderImpl@f83b30,  com.bladelogic.model.base.header.SJobHeaderImpl@f5e77b, com.bladelogic.model.base.header.SJobHeaderImpl@3046fd,  com.bladelogic.model.base.header.SJobHeaderImpl@1849a80,  com.bladelogic.model.base.header.SJobHeaderImpl@bb5cbe,  com.bladelogic.model.base.header.SJobHeaderImpl@c5d0c9,  com.bladelogic.model.base.header.SJobHeaderImpl@10e409e,  com.bladelogic.model.base.header.SJobHeaderImpl@b48015,  com.bladelogic.model.base.header.SJobHeaderImpl@44f9a0,  com.bladelogic.model.base.header.SJobHeaderImpl@60b823,  com.bladelogic.model.base.header.SJobHeaderImpl@1d9344a, com.bladelogic.model.base.header.SJobHeaderImpl@f804f8,  com.bladelogic.model.base.header.SJobHeaderImpl@10e4ee5,  com.bladelogic.model.base.header.SJobHeaderImpl@5dd34b,  com.bladelogic.model.base.header.SJobHeaderImpl@1db1ea9,  com.bladelogic.model.base.header.SJobHeaderImpl@ba164e,  com.bladelogic.model.base.header.SJobHeaderImpl@10e95ba,  com.bladelogic.model.base.header.SJobHeaderImpl@87f229,  com.bladelogic.model.base.header.SJobHeaderImpl@12b81d1,  com.bladelogic.model.base.header.SJobHeaderImpl@157e8f2, com.bladelogic.model.base.header.SJobHeaderImpl@7e812d,  com.bladelogic.model.base.header.SJobHeaderImpl@152b2a2,  com.bladelogic.model.base.header.SJobHeaderImpl@4dca28,  com.bladelogic.model.base.header.SJobHeaderImpl@1133041,  com.bladelogic.model.base.header.SJobHeaderImpl@c52709,  com.bladelogic.model.base.header.SJobHeaderImpl@185f07a,  com.bladelogic.model.base.header.SJobHeaderImpl@6f0b9b,  com.bladelogic.model.base.header.SJobHeaderImpl@62fdbf,  com.bladelogic.model.base.header.SJobHeaderImpl@10134f5, com.bladelogic.model.base.header.SJobHeaderImpl@3bcda6,  com.bladelogic.model.base.header.SJobHeaderImpl@3a5ccb,  com.bladelogic.model.base.header.SJobHeaderImpl@1a248e2,  com.bladelogic.model.base.header.SJobHeaderImpl@15f1646,  com.bladelogic.model.base.header.SJobHeaderImpl@1af61db,  com.bladelogic.model.base.header.SJobHeaderImpl@1419bc9,  com.bladelogic.model.base.header.SJobHeaderImpl@5ab927][com.bladelogic.model.base.header.SJobHeaderImpl@52a19b,  com.bladelogic.model.base.header.SJobHeaderImpl@efea28, com.bladelogic.model.base.header.SJobHeaderImpl@f5eeba,  com.bladelogic.model.base.header.SJobHeaderImpl@c23fd,  com.bladelogic.model.base.header.SJobHeaderImpl@10edbff,  com.bladelogic.model.base.header.SJobHeaderImpl@8d4d26,  com.bladelogic.model.base.header.SJobHeaderImpl@c3fb19,  com.bladelogic.model.base.header.SJobHeaderImpl@9a2bd4,  com.bladelogic.model.base.header.SJobHeaderImpl@1b39089,  com.bladelogic.model.base.header.SJobHeaderImpl@1d6133e,  com.bladelogic.model.base.header.SJobHeaderImpl@1896608, com.bladelogic.model.base.header.SJobHeaderImpl@189ad8c,  com.bladelogic.model.base.header.SJobHeaderImpl@1e0e80b,  com.bladelogic.model.base.header.SJobHeaderImpl@a26288,  com.bladelogic.model.base.header.SJobHeaderImpl@f2f3f9,  com.bladelogic.model.base.header.SJobHeaderImpl@6f6f48,  com.bladelogic.model.base.header.SJobHeaderImpl@1f2e96c,  com.bladelogic.model.base.header.SJobHeaderImpl@badb7c,  com.bladelogic.model.base.header.SJobHeaderImpl@19fbbb4,  com.bladelogic.model.base.header.SJobHeaderImpl@1dc3390, com.bladelogic.model.base.header.SJobHeaderImpl@1bd56c4,  com.bladelogic.model.base.header.SJobHeaderImpl@18b9d53,  com.bladelogic.model.base.header.SJobHeaderImpl@105dae4,  com.bladelogic.model.base.header.SJobHeaderImpl@165cd01,  com.bladelogic.model.base.header.SJobHeaderImpl@763cf8,  com.bladelogic.model.base.header.SJobHeaderImpl@9cd182,  com.bladelogic.model.base.header.SJobHeaderImpl@17ebc7a,  com.bladelogic.model.base.header.SJobHeaderImpl@1882ced,  com.bladelogic.model.base.header.SJobHeaderImpl@13d9b2a, com.bladelogic.model.base.header.SJobHeaderImpl@195febb,  com.bladelogic.model.base.header.SJobHeaderImpl@86be5e,  com.bladelogic.model.base.header.SJobHeaderImpl@3c37a6,  com.bladelogic.model.base.header.SJobHeaderImpl@1697990,  com.bladelogic.model.base.header.SJobHeaderImpl@1ac008a,  com.bladelogic.model.base.header.SJobHeaderImpl@1576c0f,  com.bladelogic.model.base.header.SJobHeaderImpl@7780c3,  com.bladelogic.model.base.header.SJobHeaderImpl@1a6aa74,  com.bladelogic.model.base.header.SJobHeaderImpl@100a998, com.bladelogic.model.base.header.SJobHeaderImpl@7e62ad,  com.bladelogic.model.base.header.SJobHeaderImpl@18066c7,  com.bladelogic.model.base.header.SJobHeaderImpl@dbbeab,  com.bladelogic.model.base.header.SJobHeaderImpl@c2fe3a,  com.bladelogic.model.base.header.SJobHeaderImpl@1c0d0cd,  com.bladelogic.model.base.header.SJobHeaderImpl@1cc4ee9,  com.bladelogic.model.base.header.SJobHeaderImpl@50de63,  com.bladelogic.model.base.header.SJobHeaderImpl@1386c1c,  com.bladelogic.model.base.header.SJobHeaderImpl@141d528, com.bladelogic.model.base.header.SJobHeaderImpl@1113be4,  com.bladelogic.model.base.header.SJobHeaderImpl@732578,  com.bladelogic.model.base.header.SJobHeaderImpl@1a0f4cb,  com.bladelogic.model.base.header.SJobHeaderImpl@276d80,  com.bladelogic.model.base.header.SJobHeaderImpl@85f5c2,  com.bladelogic.model.base.header.SJobHeaderImpl@c9b39f,  com.bladelogic.model.base.header.SJobHeaderImpl@2fb31b,  com.bladelogic.model.base.header.SJobHeaderImpl@197d9b7,  com.bladelogic.model.base.header.SJobHeaderImpl@568c8e, com.bladelogic.model.base.header.SJobHeaderImpl@25edfe,  com.bladelogic.model.base.header.SJobHeaderImpl@2bda77,  com.bladelogic.model.base.header.SJobHeaderImpl@113f636,  com.bladelogic.model.base.header.SJobHeaderImpl@1898a25,  com.bladelogic.model.base.header.SJobHeaderImpl@ccba4b,  com.bladelogic.model.base.header.SJobHeaderImpl@da9b91,  com.bladelogic.model.base.header.SJobHeaderImpl@1b6cd4,  com.bladelogic.model.base.header.SJobHeaderImpl@85d360,  com.bladelogic.model.base.header.SJobHeaderImpl@1f87000, com.bladelogic.model.base.header.SJobHeaderImpl@1814761,  com.bladelogic.model.base.header.SJobHeaderImpl@753313,  com.bladelogic.model.base.header.SJobHeaderImpl@6c32fd,  com.bladelogic.model.base.header.SJobHeaderImpl@187aa51,  com.bladelogic.model.base.header.SJobHeaderImpl@1becb66,  com.bladelogic.model.base.header.SJobHeaderImpl@11ba0b1,  com.bladelogic.model.base.header.SJobHeaderImpl@d2d572,  com.bladelogic.model.base.header.SJobHeaderImpl@1bb3e26,  com.bladelogic.model.base.header.SJobHeaderImpl@1ed5cc2, com.bladelogic.model.base.header.SJobHeaderImpl@650211,  com.bladelogic.model.base.header.SJobHeaderImpl@16aaa4a,  com.bladelogic.model.base.header.SJobHeaderImpl@1d21551,  com.bladelogic.model.base.header.SJobHeaderImpl@1757ee7,  com.bladelogic.model.base.header.SJobHeaderImpl@de7698,  com.bladelogic.model.base.header.SJobHeaderImpl@13c03f6,  com.bladelogic.model.base.header.SJobHeaderImpl@1283524,  com.bladelogic.model.base.header.SJobHeaderImpl@b8ecd3,  com.bladelogic.model.base.header.SJobHeaderImpl@c437ff, com.bladelogic.model.base.header.SJobHeaderImpl@3846bd,  com.bladelogic.model.base.header.SJobHeaderImpl@ac4c76,  com.bladelogic.model.base.header.SJobHeaderImpl@1d00eb7,  com.bladelogic.model.base.header.SJobHeaderImpl@7622bf,  com.bladelogic.model.base.header.SJobHeaderImpl@1e34274,  com.bladelogic.model.base.header.SJobHeaderImpl@11fdbf9,  com.bladelogic.model.base.header.SJobHeaderImpl@a2ec4d,  com.bladelogic.model.base.header.SJobHeaderImpl@47babc,  com.bladelogic.model.base.header.SJobHeaderImpl@134c327, com.bladelogic.model.base.header.SJobHeaderImpl@f83b30,  com.bladelogic.model.base.header.SJobHeaderImpl@f5e77b,  com.bladelogic.model.base.header.SJobHeaderImpl@3046fd,  com.bladelogic.model.base.header.SJobHeaderImpl@1849a80,  com.bladelogic.model.base.header.SJobHeaderImpl@bb5cbe,  com.bladelogic.model.base.header.SJobHeaderImpl@c5d0c9,  com.bladelogic.model.base.header.SJobHeaderImpl@10e409e,  com.bladelogic.model.base.header.SJobHeaderImpl@b48015,  com.bladelogic.model.base.header.SJobHeaderImpl@44f9a0, com.bladelogic.model.base.header.SJobHeaderImpl@60b823,  com.bladelogic.model.base.header.SJobHeaderImpl@1d9344a,  com.bladelogic.model.base.header.SJobHeaderImpl@f804f8,  com.bladelogic.model.base.header.SJobHeaderImpl@10e4ee5,  com.bladelogic.model.base.header.SJobHeaderImpl@5dd34b,  com.bladelogic.model.base.header.SJobHeaderImpl@1db1ea9,  com.bladelogic.model.base.header.SJobHeaderImpl@ba164e,  com.bladelogic.model.base.header.SJobHeaderImpl@10e95ba,  com.bladelogic.model.base.header.SJobHeaderImpl@87f229, com.bladelogic.model.base.header.SJobHeaderImpl@12b81d1,  com.bladelogic.model.base.header.SJobHeaderImpl@157e8f2,  com.bladelogic.model.base.header.SJobHeaderImpl@7e812d,  com.bladelogic.model.base.header.SJobHeaderImpl@152b2a2,  com.bladelogic.model.base.header.SJobHeaderImpl@4dca28,  com.bladelogic.model.base.header.SJobHeaderImpl@1133041,  com.bladelogic.model.base.header.SJobHeaderImpl@c52709,  com.bladelogic.model.base.header.SJobHeaderImpl@185f07a,  com.bladelogic.model.base.header.SJobHeaderImpl@6f0b9b, com.bladelogic.model.base.header.SJobHeaderImpl@62fdbf,  com.bladelogic.model.base.header.SJobHeaderImpl@10134f5,  com.bladelogic.model.base.header.SJobHeaderImpl@3bcda6,  com.bladelogic.model.base.header.SJobHeaderImpl@3a5ccb,  com.bladelogic.model.base.header.SJobHeaderImpl@1a248e2,  com.bladelogic.model.base.header.SJobHeaderImpl@15f1646,  com.bladelogic.model.base.header.SJobHeaderImpl@1af61db,  com.bladelogic.model.base.header.SJobHeaderImpl@1419bc9,  com.bladelogic.model.base.header.SJobHeaderImpl@5ab927]128128
    Command execution failed.  com.bladelogic.cli.factory.CommandNotFoundException: Found command  'Delete.deleteModelObjectAndDependentObjects' but with mismatching arguments.
    //@/C/Program Files/BMC  Software/BladeLogic/8.0/NSH/tmp/application_server/scripts/job__63777bd1-9e28-415c-ad0b-559bb92d7adb/script_DBKey-SJobKeyImpl-2007912-1__bbe4b441-ac2a-40e6-bc86-abce232426ff.2046866.1_Test.nsh:19:  command not found: jobKey
  • 5. Old Jobs Deletion Task.
    Bill Robinson

    you kept the variable there on one line?  also try changing the loop in the script to the below and see if we are getting all the output we need.

     

    for item in {0..$((${listLength}-1))}

    do

    blcli_execute Utility setTargetObject jobHeaders

    blcli_execute Utility listItemSelect ${item}

    blcli_execute Utility setTargetObject

    blcli_execute SJobHeader getDBKey

    blcli_storeenv jobKey

    blcli_execute SJobHeader getObjectTypeId

    blcli_storeenv jobTypeId

    echo "${jobTypeId},${jobKey}"

    #blcli_execute Delete deleteModelObjectAndDependentObjects ${jobTypeId} ${jobKey}

    done

  • 6. Old Jobs Deletion Task.
    Shirish Katariya

    Hi Bill,

                   Yeah Its Working.... Its deleting the jobs but not all, Some of the Jobs are still in it. and i am not getting the reason for what they are not get deleted? If you have answer for this then please let me know, and Thanks for this help.

     

    Cheers....

    Shirish.

  • 7. Re: Old Jobs Deletion Task.
    Bill Robinson

    From your output it looks like it’s not running the delete because the right args are not getting passed to the delete command.

  • 8. Old Jobs Deletion Task.
    Shirish Katariya

    Right now i am able to delete the jobs but from them some of the jobs are still not get deleted. so what should be next step?

  • 9. Re: Old Jobs Deletion Task.
    Bill Robinson

    what error do you get when it fails to delete?  the one you pasted or something else ?

  • 10. Re: Old Jobs Deletion Task.
    Shirish Katariya

    Hi Bill,

     

    The script provided by you was working fine bt i have a big doubt... at bold line:::

     

    blcli_execute SmartJobGroup groupNameToId "/some/job/folder_name/smartgroup"
    blcli_storeenv jobGroupId
    blcli_execute Job findAllHeadersByGroup ${jobGroupId}
    blcli_execute Utility storeTargetObject jobHeaders
    blcli_execute Utility listLength
    blcli_storeenv listLength

    echo ${listLength}
    for item in {0..$((${listLength}-1))}
            do
            blcli_execute Utility setTargetObject jobHeaders
            blcli_execute Utility listItemSelect ${item}
            blcli_execute Utility setTargetObject
            blcli_execute SJobHeader getDBKey
            blcli_storeenv jobKey
            blcli_execute SJobHeader getObjectTypeId
            blcli_storeenv jobTypeId
            blcli_execute Delete deleteModelObjectAndDependentObjects ${jobTypeId} $
    {jobKey}
    done

     

    if i have executed this script to respective job smart group, so may it possible that it will delete all jobs from the "Jobs" folder???

     

    plzz help.

     

    Thanks,

    Shirish.

  • 11. Re: Old Jobs Deletion Task.
    Lazar NameToUpdate

    for the follow up issue where all jobs disappeared watch this thread:

    https://communities.bmc.com/communities/thread/72850?tstart=0

  • 12. Re: Old Jobs Deletion Task.
    Bill Robinson

    it's going to get the group id of the path that you pass. and then as you can see it deletes every job it finds in that group.

     

    what path did you pass into that command ?