Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Deleting IFS Files with QSHELL

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

  • Guest's Avatar
    Guest replied
    Deleting IFS Files with QSHELL

    How are you on QSHELL PTFs? Other than that, I'm out of ideas.

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Deleting IFS Files with QSHELL

    I tried the QSHELL command 'find /Reports f -name "*.xls" - mtime +30 -exec rm -f{} ;' but couldn't get it to work on our system. I'm running it in a batch submitted CL. When I run it without the '-exec rm -f{} ;' portion I get a list of all the files that haven't been modified in over 30 days but once I put the '-exec re -f{} ;' it comes back with a return code of 1... any ideas what I'm doing wrong?
    Code

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Deleting IFS Files with QSHELL

    I tried running the 'find' without the 'exec' both in batch and interactively. It ran fine in both. It created a list that I put into a physical file when I ran it in batch.

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Deleting IFS Files with QSHELL

    I created a test file and ran the script in batch with no problems; I used '-mtime +0' and '-f {}'. So it looks like your script is basically OK. When you ran just the 'find' without the 'exec', was that interactively or in batch? If it produced the list in batch, then I'm out of ideas for now. If it fails in batch, then you may need to allow more jobs for the subsystem. The STRQSH spawns Batch Immediate jobs in the subsystem that do not go through a jobq, so even if you have a single-threaded jobq, multiple jobs will run in the subsystem. To see how the subsystem is set up, use DSPSBSD item 1. If it shows 3 or more Maximum Jobs, you should be OK. (Item 6 shows the max active jobs for a subsystem, but the Batch Immed jobs don't count towards that total.) Maybe 3 wouldn't be enough; maybe the -exec spawns its own job(s).

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Deleting IFS Files with QSHELL

    I added the space and it ran with the command exit status of zero (command ended normally) but the files are still in the folder. So at least by adding space between -f and the {} got the command ended normally. Any other ideas?

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Deleting IFS Files with QSHELL

    What happens if you put a space between the -f and the braces, like '-f {}'? The example in the InfoCenter has a space between the -f and the filename. The {} expands to the pathname of the current file, so without the space, it may be trying to process -f/Reports/MyFile.xls and getting confused, instead of -f /Reports/MyFile.xls

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Deleting IFS Files with QSHELL

    Thank you for pointing out my errors. I was in a hurry when I posted this message. Below is the correct CL source that I'm having problems with. Any ideas, why this won't work?
    Code

    Leave a comment:


  • Guest's Avatar
    Guest started a topic Deleting IFS Files with QSHELL

    Deleting IFS Files with QSHELL

    Your examples are a little confusing; the first parts aren't the same. In the Code section of this msg, I list the example from your message text, followed by the example from your code. The version in the message is missing '-type', and has a space between the dash and 'mtime'. Also, in your message text, you say '-exec rm', and then '-exec re'. I think the latter would return an error, as it does not exist. The examples also have '-f{}'; should there be a space between the f and the braces, like '-f {}'? In your examples, you have double quotes " around the *.xls. Does it make a difference if you have two single quotes ''?
    Code
Working...
X