Link to home
Start Free TrialLog in
Avatar of UserAlreadyExists
UserAlreadyExistsFlag for United States of America

asked on

Scripting in Cygwin

Hello,

I am in a situation here at work where.

I've been asked to delete some files by date... Easy enough right?

The kicker here is that i have to do so against 20+ million files in a single NAS Dir... Oh yeah, I know! Any way, I do not have a Unix server to work with and the windows API basically excretes a brick when I try any "Windowy" method of doing this (cmd, WMI, bla bla bla). I do however have access to a windows 2003 server running Cygwin which I am trying to utilize against the NAS directory for the clean up effort.

Here's the issue. I have mapped the NAS directory as a drive on the Windows box and am wanting to run a command something like: find . -mtime +186 -exec rm -f {} \; -print but with the right logic in place so as to identify only the right files. As I am no Unix expert I am taking baby steps towards that end.

The NAS dir does have subdirectories which include files that must not be deleted which is ok as the target files are all .log but when I try to run a simple find . -name  "*log"
I get back the below where I am expecting to see many many files. Any help here would be very appreciated. Oh, and I just joined today and have yet to have the time to read up on points and all that so please be forgiving and let me know if i've broken and social rules here in regard to points.
Thank you

$ find . -name  "*log"
./ESUB20081023.log
./ESUB20081024.log
./SubmissionDocSrv20081024.log
./SubmissionDocSrv_20081107.log
./SubmissionDocSrv20081027.log
./SubmissionDocSrv_20081110.log
find: /cygdrive/z/TransformXML changed during execution of find (old inode numbe
r -425971704, new inode number -416921728, filesystem type is system) [ref 1114]

find: /cygdrive/z/TransformXML changed during execution of find (old inode numbe
r -425971704, new inode number -431260960, filesystem type is system) [ref 1114]
SOLUTION
Avatar of serialband
serialband
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial