IBM i

 View Only
Expand all | Collapse all

Archiving an IFS

  • 1.  Archiving an IFS

    Posted Wed April 20, 2022 08:47 AM
    Hi Everyone,

    Can someone please help me to archive an IFS in IBM i. I use the command CPYTOARCF, but the first parameter (From file or directory) is not allowing me to paste the complete IFS path which is (/vendors/saphanat/interface/ar/data/backup_in) due the the length. 

    Can someone guide me the step by step process to archive the IFS ? 

    Thanks
    Avinash

    ------------------------------
    Avinash Yadav
    ------------------------------


  • 2.  RE: Archiving an IFS

    Posted Wed April 20, 2022 10:08 AM
    Hi

    You may first type the command with the long 'fromfile' parameter before you press F4 to prompt the cmd. This will allow you to enter a much longer path ;-)
      CPYTOARCF FROMFILE('/your/veeeeeeeeeeeeeeeerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrryyyyyyyyyyyyyyyyyyyyyyyyyyyy/long/path/name') -> F4

    Or use other tools to archive IFS objects like:
    * system save commands SAV DEV('/qsys.lib/my.lib/mysavf.file') ...
    * with jdk installe -> qsh cmd('java jar -cfM')
    * with open source support aktive (PASE and YUM) -> just install zip and unzip and use them with qsh
    * there may be other ways 

    Markus

    ------------------------------
    Markus Neuhold
    ------------------------------



  • 3.  RE: Archiving an IFS

    Posted Wed April 20, 2022 11:12 AM

    Just type the '&' character (without quotes) in the first position of the command field and press enter. The field will expand in length. You can do this more than one time.

     

     

    www.remainsoftware.com

    See our video to learn more about Remain.






  • 4.  RE: Archiving an IFS

    Posted Wed April 20, 2022 11:49 AM
    ThankYou, It worked. I have another issue with sorting the files. I have close to 2 lac objects inside /root/vendors/saphanat/interface/ar/data/backup_in directory. Hope you can see the screenshot attached.

    How can I sort out this objects by year and zip it in a new folder ?  Customer doesn't want to zip the directory, they want this objects to zip by year. 

    Appreciate all the help- Thanks.






  • 5.  RE: Archiving an IFS

    Posted Thu April 21, 2022 08:47 AM
    What I find sad is that exact screen you are using has an unzip option but not a zip option.  Check out Actions.
    This looks like a candidate for an "idea":  https://ideas.ibm.com/

    See if you can find an open source version of zip to install on IBM i so that you can do something like the following in qsHell or somesuch thing:
    zip -r /home/rob/test.zip $(find /home/rob -type f -mtime +500)
    where 500 is the number of days

    ------------------------------
    Robert Berendt
    ------------------------------



  • 6.  RE: Archiving an IFS

    Posted Thu April 21, 2022 09:29 AM
    Thanks, I will try that and post the same in ideas.

    One more concern I have is, If you see the below screenshot, that IFS has duplicates of DN.SD002.INS.20200
    those are in thousands. 

    1. How can I copy them in a separate folder ? Any way to copy them through SQL in a different folder ?








  • 7.  RE: Archiving an IFS

    Posted Thu April 21, 2022 09:59 AM
    Those aren't duplicates, that screen can only show you so many characters.  If you position on any one of them there will be a function key to display the whole name.  I think it is F22 aka Shift-F10.
    You can use a different interface, like the iACS you were using earlier, to see the whole name also.

    You can also use that GUI to:
    1. Create new directories, like 2020, 2021, ...
    2. Sort the list by date
    3. Copy all those created in 2020 and paste them into the folder 2020
    4. Delete those from the original directory
    Then you can use CPYTOARCF to zip up the new directories.

    ------------------------------
    Robert Berendt
    ------------------------------



  • 8.  RE: Archiving an IFS

    Posted Fri April 22, 2022 12:18 PM
    You can user Qsh jar to zip or unzip files






  • 9.  RE: Archiving an IFS

    Posted Thu April 21, 2022 11:15 AM
    @Avinash Yadav if it's a one-time job you may search for an AIX zip binary, then upload it in binary mode to your server. use qsh cmd('/path/2/zipfile/zip ....') to do the zip operation. 

    If you are planning to use it on a regular base, you should read yourself into https://ibmi-oss-docs.readthedocs.io/en/latest/README.html or https://ibm.github.io/ibmi-oss-resources/ (IBM i Open Source) and use YUM (or ACS) to install and update the zip binary for the PASE environment.

    Markus​​

    ------------------------------
    Markus Neuhold
    ------------------------------



  • 10.  RE: Archiving an IFS

    Posted Thu April 21, 2022 01:14 PM
    ThankYou everyone for the suggestions, but my issue now is segregating the objects under the below directory since my iACS gets crashed in the middle while populating all objects from the directory /backup_in. 
    As @Robert Berendt suggested to create a directory using iACS, but the issue is, when I access the IFS /vendors/saphanat/interface/ar/data/backup_in  using iACS, and when it starts to load all objects under backup_in, it gets crashed. I tried this multiple times and my ACS gets crashed everytime. There are close to 2 lacs objects under /backup_in. Below screenshot i took before my iACS crashed.


    Question : What are the other ways I can sort the list by date ?





  • 11.  RE: Archiving an IFS