Thanks for the responses!

I think we will try this, I'm sure it will work for us.

We were actually considering doing it manually with a mapped Windows drive, although the first time would be huge!

Your comment about creation date v last modified makes a lot of sense. I will discuss that with the business owners of the files. We may be OK with creation date though as we are just going to move them to a different directory (to exclude from the backup), not delete them.


Adam Driver
QUINNOX | Accelerate Success
Phone: +1 847 916 9499
Mobile: +1 608 772 8538

subject: Re: Move IFS files based on date

Ok, you're running this once a month.

What is this worth to you to automate it?

For example, you could go into iNav. Sort the contents of the 'from'

directory by any choice of 'create date', 'change date', etc. Select the

dates you want, highlight those rows and move the suckers.

Or, you could read Scott Klement's IFS APIs and read the directory, save

the object, move the object, next.

Could even take it to an extreme and as part of the move, add it to a zip,

jar or some related file.

Rob Berendt


IBM Certified System Administrator - IBM i 6.1

Group Dekko

Dept 1600

Mail to: 2505 Dekko Drive

Garrett, IN 46738

Ship to: Dock 108

6928N 400E

Kendallville, IN 46755


from: "Porterfield, Sean" <SPorterfield@xxxxxxxx<mailto:SPorterfield@xxxxxxxx>>

subject: RE: Move IFS files based on date

As an example response, I have the following in a shell script that is on the job scheduler to be run through QP2SHELL:

find /tmp/sq* -mtime +21 -exec rm {} \;

That deletes /tmp/sq* if it's older than 21 days. You could use mv instead of rm to move it somewhere else. You could probably do something clever with date calculations if you need to match a month specifically rather than "older than x days"

Command : CALL PGM(QP2SHELL) PARM('/QOpenSys/usr/bin/sh' 'myscript.sh')

Other methods I tried failed due to the number of files found.


Sean Porterfield

from: Scott Klement <midrange-l@xxxxxxxxxxxxxxxx<mailto:midrange-l@xxxxxxxxxxxxxxxx>>

subject: Re: Move IFS files based on date

I don't know an easy way to do this based on creation date, but if

you're willing to use the last modified/changed date, then it should be

pretty easy to do with QShell.

Actually, I wonder if the last modified date wouldn't be a better idea,

anyway -- you'd want to back it up if it has been modified, wouldn't

you? Unless things are never modified after they are created -- in

which case, it wouldn't matter which date you used, they'd always be the

same, right?


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute, print or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. Any views or opinions presented in this email are solely those of the author and do not necessarily represent the views of the company. Although the company has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments.

This thread ...

Return to Archive home page | Return to MIDRANGE.COM home page