8 Replies Latest reply on Apr 11, 2013 6:48 PM by TamilSelvan Easwaran

    BLPackage for file Deletion

      Hi Team,


      I need to implement File Deletion capability through BSA.


      Please guide me to use the right procedure for file deletion.


      I have two inputs in Mind ;


      1. Folder contaning File List

      2. Folder containing actual Files.


      Can I use the BLPackage for this.


      If yes, help me with the BLCLI command for changing the "Action" to delete.


      If no, please suggest me the other ways.




        • 1. Re: BLPackage for file Deletion
          Barry McQuillan

          Hi Tamil,


          So are you wanting to create a BLPackage/NSHScript that will delete a list of files?

          Are these Depot files in BSA or just files located on a Target server?


          I don't understand the first input?

          Do you mean something like:

          1. A file containing a pattern list for all files to be deleted (or could just contain file names).

          2. The folder to search for file that should be deleted

          1 of 1 people found this helpful
          • 2. Re: BLPackage for file Deletion

            Hi Tamil,

            Like Barry has written, it will help to know a few more details of the use case you are trying to achieve and the criteria you wish to use for file deletion.

            I am assuming that its not simple, else you would have used a NSH script job with parameters to pass the directories that were to be cleaned, right?

            Meanwhile, to find how you can set the action to delete, please check the example of the following BLCLI:
            BlPackage : importDepotObjectToPackage

            There it shows how "Action" property can be modified/set to "Add/Delete/Modify"

            1 of 1 people found this helpful
            • 3. Re: BLPackage for file Deletion
              Siddu angadi

              Hi Tamil,


              if the files are same across all the servers, use BLPackage and change Action to delete as Amol mentioned.


              If the filenames are different and you have some logic to find, then use NSHScripting.




              1 of 1 people found this helpful
              • 4. Re: BLPackage for file Deletion

                Hi Barry,


                Thanks for the update.


                Here's my scenario :


                We have a monthly deletion process in our target servers.


                Usually, we get a filelist of the files to be deleted.


                We were using a unix script to delete the files until now.


                Thinking of using BSA for this process.


                My Idea in mind :




                Instead of file-list, I will be preparing a package of the files to be deleted, which will be taken as a blpackage.


                Modify the action to be "delete"


                Then deploy the BLPackage, which will delete the files.




                But am not sure how I am going to automate this.


                Let me know if I can use file-list instead of creating a blpackage.


                Also let me know if you think of any other possibilities.




                • 5. Re: BLPackage for file Deletion
                  Barry McQuillan

                  Hi Tamil,


                  Is the file list different every month?

                  Is it the same list for every server or a list of different files for each server?


                  I'd probably use a Type 2 NSH Script for this rather than create a BLPAckage, unless its the same files every month.

                  Something like:




                  FILE_LIST_PATH="$1" #path must be fully qualified NSH path e.g. //servername/path/to/file

                  # this method means that the person supplying the list can just place it somewhere that they have permissions (presumably not on the BSA appserver).

                  TARGET_LIST="$2" #space separated list of targets passed into script using the %h parameter


                  for SERVER in TARGET_LIST


                       for FILE in `cat -v ${FILE_LIST_PATH}`


                            rm "//${SERVER}/${(q)FILE}"






                  Please Review this code as I haven't tested it, I just threw it together to give you an idea.

                  • 6. Re: BLPackage for file Deletion

                    Thanks Barry,


                    Answers to your Query :


                    1. The file list is different every month

                    2. The files would be the same for all the servers


                    Thanks for your inputs.


                    Out of interest, Am asking the below question :


                    1. Is there any BLCLI command to change the BLPackage Action (add/delete/modify) while creating the BL Package.


                    Right now Am using the below command for creating BL Package :


                    BlPackage : createPackageFromComponent


                    This does not allow me to change  the "Action" . the default is coming as "AddQuery.jpg"




                    • 7. Re: BLPackage for file Deletion
                      Bill Robinson

                      I don't know why you want to use a blpackage here when a nsh script is the right thing to use.


                      using a blpackage requires you to:

                      - create a blpackage that contains each of the files/folders you want to remove

                      - modify the action to 'delete' (which i don't believe is currently possible in the blcli)

                      - create a job and deploy the blpackage.


                      when instead you can use the loop like barry mentioned above.

                      • 8. Re: BLPackage for file Deletion

                        Thanks for the info Bill,


                        The reason, why I was stressing on BLPackage was due to the design in mind.


                        But I'll take your word and carry on with NSH Script.


                        Thanks for Barry !!!