I am trying to copy 2 types of files so I can archive them. I tested with a set of commands:
touch -t $(date -d "-60 day" +%Y%m%d) WORKDIR/REF
find TARGETDIR/ -type f -maxdepth 1 -iname \*.out\* -or -iname \*.log\* ! -newer WORKDIR/REF -exec ls -l {} \;
This correctly lists any files in the directory over 60 days old with .log or .out in the name. But when I execute this in a ksh script, I only get whichever string I have listed last, in this case I only get the .log files. Switching log and out, I only get the .out files.
I can do this with 2 separate find commands, but I was wondering why it won't work as a single comd in the ksh script?