find /data -mtime -10 -print
I get an accurate listing of all files that were modified
in the last 10 days. But when i type something like...
cp -auv `find /data -mtime -10 -print` /backup
All of my files get copied over (even those last accessed
> 10 days ago). What am I missing?
I'm using stock RedHat 7.1 with all the latest update incl.
2.4.3-12 kernel.
TIA
find ~/crud -mtime -10 -print
~/crud
~/crud/file_modified_today
~/crud/file_modified_yesterday
[...]
The ~/crud directory shows up because it has been modified within the
last 10 days. You could pipe the output of the find through grep -v
"/data", or you could add "-type f" if you don't have empty directories
to back up, or you could do a couple of other things.
--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / That which does not kill us
http://www.brainbench.com / makes us stranger.
-----------------------------/ --Trevor Goodchild, "AEon Flux"
man cp
[snip]
-a, --archive
same as -dpR
^
The recursive flag is grabbing every file in /data's subdirectories.
cp -dpuv `find /data -mtime -10 -print` /backup
# OR
find /data -mtime -10 -exec cp -dpuv {} /backup
John
--
use Perl;
program
fulfillment