4 Replies Latest reply on Dec 11, 2014 8:15 AM by rishabh kshirsagar

    blcli - arg list too long: error

      Hi

       

      I am trying to fetch the all the underlying Blpackage name, Its fully qualified path and Blpackages Last Modification date present in a particular "Depot Path".

       

      Please find the blcli code below :-

      ####### using While loop ################

      blcli_execute DepotGroup groupNameToId "$DEPOT_PATH"

      blcli_storeenv depot_grpid

      blcli_execute DepotObject findAllByGroup $depot_grpid true

      blcli_execute DepotObject getDBKey

      blcli_execute Utility setTargetObject

      blcli_execute Utility listPrint

      blcli_storeenv dbkey_list

       

      echo "$dbkey_list" > Db_key_List.txt

       

      while IFS= read -r key

      do

      blcli_execute DepotObject getTypeByDBKey $key

      blcli_storeenv blpackage_type

      if [[ ${blpackage_type} -eq 28 ]];then

        blcli_execute DepotObject getTypeByDBKey $key

        blcli_storeenv blpackage_type

        blcli_execute DepotObject getNameByDBKey $key

        blcli_storeenv blpackage_name

        blcli_execute DepotObject findByDBKey ${key}

        blcli_execute DepotObject getGroupId  

        blcli_storeenv groupId

        blcli_execute DepotObject findByDBKey ${key}

        blcli_execute DepotObject getDateModified

        blcli_storeenv date_modified

        blcli_execute Group findById ${groupId}  

        blcli_execute Group getType 

        blcli_storeenv groupTypeId

        blcli_execute Group getQualifiedGroupName ${groupTypeId} ${groupId}

        blcli_storeenv groupPath

        ############ Modifiy the date in YYYYMMDD format ################

        date_modified=`/bin/date -d"$date_modified" +%Y%m%d%H%M`

        echo "${groupPath},${blpackage_name},$date_modified"

      fi

      done < Db_key_List.txt

       

      While running the above code I am getting error as "arg list too long: /bin/date"

      Db_key_List.txt contains 4215 rows (dbkeys)

       

       

      Earlier I tried the "for" loop as well and getting the same error.

      ####### using For loop ################

      blcli_execute DepotGroup groupNameToId /GET/GFM/GFM

      blcli_storeenv depot_grpid

      blcli_execute DepotObject findAllByGroup $depot_grpid true

      blcli_execute DepotObject getDBKey

      blcli_execute Utility setTargetObject

      blcli_execute Utility listPrint

      blcli_storeenv dbkey_list

       

      for key in $dbkey_list

      do

      echo "Dbkey is $key"

      blcli_execute DepotObject getTypeByDBKey $key

      blcli_storeenv blpackage_type

      if [[ ${blpackage_type} -eq 28 ]];then

        blcli_execute DepotObject getTypeByDBKey $key

        blcli_storeenv blpackage_type

        blcli_execute DepotObject getNameByDBKey $key

        blcli_storeenv blpackage_name

        blcli_execute DepotObject findByDBKey ${key}

        blcli_execute DepotObject getGroupId  

        blcli_storeenv groupId

        blcli_execute DepotObject getDateModified

        blcli_storeenv date_modified

        blcli_execute Group findById ${groupId}  

        blcli_execute Group getType 

        blcli_storeenv groupTypeId

        blcli_execute Group getQualifiedGroupName ${groupTypeId} ${groupId}

        blcli_storeenv groupPath

        ############ Modifiy the date in YYYYMMDD format ################

        date_modified=`/bin/date -d"$date_modified" +%Y%m%d%H%M`

        echo "${groupPath},${blpackage_name},$date_modified"

      fi

      done

       

      Please suggest what I am missing.

       

      Thanks,

      Rishabh