I use the find command to retrieve files between a specific time and tar 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, I get: find: invalid predicate `-newermt '. what is the problem? and how can I get around this.
UPDATE: What I'm actually trying to do is path (using 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 use grep for example1 and got the 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 tar files based on time.since touch does not work with the file. I chose find command.thing, I have to do this from the root directory.
touch /lag/cnn/*/* start -d "2013-12-19 00:00"
will not work for sure. So, is there a way to read files between a specific time and tar, or use this touch to use -newer and find files between a specific time.
linux command
user2572985
source share