find: invalid predicate when using -newermt

Viewed 14906

I am using a find command to get files between a certain time and tar it with the following command,

  find /lag/cnn -max-depth 3 -newermt "2013-12-19 00:00" -o -type f -newermt "2013-12-16 00:00" -print0 | 
   xargs -0 tar acf out.tar.gz

but when i run this command am getting: find: invalid predicate `-newermt' . what is the problem? and how i can work around this.

UPDATES: What i am actually trying to do is, path is (used ls -lrt /lag/cnn/*/*):

        /lag/cnn/Example1/one/a.tar.gz
        /lag/cnn/Example1/two/a.tar.gz
        /lag/cnn/Example1/three/a.tar.gz
         /lag/cnn/Example2/one/a.tar.gz

I am using grep for Example1 and got a list in sample.txt as follows,

        /lag/cnn/Example1/one/a.tar.gz
       /lag/cnn/Example1/two/a.tar.gz
       /lag/cnn/Example1/three/a.tar.gz

from this sample.txt i want to tar files based on time.since touch doesn't work on a file. i opted find command.thing is i need to do this from root directory.

          touch /lag/cnn/*/* start -d "2013-12-19 00:00"

will not work for sure. So is there any way to read files between a certain time and tar it or how to use this touch to use -newer and find files between certain time.

2 Answers
Related