Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

IFS Cleanup

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • IFS Cleanup

    RMVLNK OBJLNK('Directory1/*') This CL command will remove everything under the Directory1 object path. My command actually goes two more levels deep. Not sure how "low you can go"........... I execute this every night to remove temporary PDF files that are created during the day through one of our s/w packages.

  • #2
    IFS Cleanup

    Using QShell is one option. Qshell supports the unix find utility/command. Here is an example command... find . -type f -name "*.pdf" -mtime +30 -exec rm -f {} ; This will start in the current directory and find all files that have a suffix of pdf and have not been modified within the last 30 days. In this example the find cascades down the subdirectories under the current working directory. Alternatively to -mtime you could specify -atime which indicates last access (read but not modified).

    Comment


    • #3
      IFS Cleanup

      I like that. BTW, is Qshell free? If so, how do I install it. I don't have it installed, I know this because I just tried to start it. STRQSH.

      Comment


      • #4
        IFS Cleanup

        I believe this would be on your install disks that come with the operating system and licensed programs. It is 5722SS1 Option 30 on our V5R2 box.

        Comment


        • #5
          IFS Cleanup

          Thanks Sonny, I am going to see if I have this and install it. I could really use some unix commands!!!!!!!!!!!!!

          Comment


          • #6
            IFS Cleanup

            I've found that this appears to run a QZSHFCHLD job for each file it deletes. On my system, they leave joblogs behind, even though they complete normally. I haven't been able to figure out what jobd they're using (so I can change it), or if there's an ENVVAR I can use, or if the process can run "in" the session rather than run separate BCI jobs. I ended up with several thousand joblogs after cleaning up an old directory....

            Comment


            • #7
              IFS Cleanup

              Never mind, found some answers here http://www.itjungle.com/guruo/mgo022202-story01.html and here http://archive.midrange.com/midrange.../msg00612.html

              Comment


              • #8
                IFS Cleanup

                Sorry this should work without starting a job for each file. I updated this on antoher site, but forgot to paste it back here.
                Code

                Comment


                • #9
                  IFS Cleanup

                  We have started to use the IFS to put PDF doc out there for users that don't need to access the green screens. Does anybody know a way or a tool to automatically do cleanup of directories in the IFS. We want to keep docs online for 30 day and then they are deleted. It is getting to be a pain to manually clean this up.

                  Comment


                  • #10
                    IFS Cleanup

                    Dave, I tried the QSHELL command that you have here but couldn't get it to work on our system. I'm running it in a batch submitted CL the code is below. When I run it without the '-exec rm -f{} ;' portion I get a list of all the files that haven't been accessed in over 30 days but once I put the '-exec re -f{} ;' back it comes back with a return code of 1... any ideas what I'm doing wrong?
                    Code

                    Comment

                    Working...
                    X