Hello, I want to copy a bunch of Log files in a /IFSDIR/*.* to another LPAR. My research tells me to do something like this. CPY /IFSDIR/*.* /QFileSvr.400/LPAR_Name/IFSDIR/ How do I instruct QSHELL to only copy files that are +30 days old? Can I use -mtime +30 in some way? My testing thus far have not been sucessful, but its probably because my same user profile does not exist on the target LPAR. Thanks, Keith
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
Copying /IFS Lpar1 to Lpar2 Question.
Collapse
X
-
Re:Copying /IFS Lpar1 to Lpar2 Question.
Update.... I made some progress last week on identifying a method to solve my problem. I will paste my test script here, but I have a question. # Below are some test Unix QShell scripts moving data # back and forth between two LPARS on the same system. # Then cleaning up the folder to regain space. # Using /tbcklb on TBCTEST and /tbcklb on TKIHQ as a test environment. # # This command is used in the IBM Scheduler to run this script # on Development Box. Very cool you can execute from either end # to get the same results. # STRQSH CMD('qsys.lib/itools.lib/qtxtsrc.file/ifscpy.mbr') # # Create IFS Pointer to Production LPAR Root. mkdir /QFileSvr.400/TKIHQ # # Copy Development /tbcklb/*.* to Production LPAR /tbcklb cp /tbcklb/*.* /QFileSvr.400/TKIHQ/tbcklb/ # # Then... # # Copy Production LPAR /tbcklb/*.* to TBCTEST LPAR /tbcklb/save cp /QFileSvr.400/TKIHQ/tbcklb/*.* /tbcklb/save # # Then... # # Copy Production LPAR /tbcklb/*.* to TBCTEST LPAR /tbcklb/direc cp /QFileSvr.400/TKIHQ/tbcklb/*.* /tbcklb/direc # # Then... # # Remove from Development /tbcklb to save space. rm /tbcklb/*.* # # Or... # # Delete files from Development /tbcklb that are >30 days old. find /tbcklb/save/*.* -mtime +30 -exec rm {} ';' Question about this line? mkdir /QFileSvr.400/TKIHQ mkdir: 001-2128 Error found creating directory /QFileSvr.400/TKIHQ. File exists. Is there a way to monitor for this message similar to a MONMSG in the text I have above is this already exists? Thanks, Keith
-
Re:Copying /IFS Lpar1 to Lpar2 Question.
This one is driving me nuts! Why does this work... # Delete files from Development /tbcklb that are >30 days old. find /tbcklb/save/*.* -mtime +30 -exec rm {} ';' But this does not... # Copy files that are >30 days to another folder. find /tbcklb/*.* -mtime +30 -exec cp /tbcklb/save {} ';' Get Error... cp: 001-2127 /tbcklb/save is a directory and was not copied. What am in missing? Is there another way of doing this? Thanks, Keith
Comment
-
Re:Copying /IFS Lpar1 to Lpar2 Question.
Hello Bill, I got around this one by using the following statement. # Create IFS Pointer to Production LPAR Root. if mkdir /QFileSvr.400/TKIHQ then echo TKIHQ was created. else echo TKIHQ already exists. fi Using the if statement monitors for you for the completion. I got this tip from another website, and it got me around this problem. Thanks for your reply. I did try what you suggested, but the other error was just as bad.
Comment
Comment