problem with using find and tar together
Hi, what I have been trying to do is tar up all the files that were touched in the last 24 hours into a single file. Seems simple right?
sohpsy211:/respaldo # find /home/am0032/ -mtime 0 found all the files as expected... but as soon as I did this .... sohpsy211:/respaldo # find /home/am0032/ -mtime 0 | tar zcvf /respaldo/today.tgz -T- Then the input from the find command was ignored and the entire contents of /home/am0032/ starts to get tarred up. Any ideas why? Or how to get around this? Many thanks for any assistance. Adam |
try this:
Code:
find /home/am0032/ -mtime 0 -exec tar zcvf /respaldo/today.tgz \; HTH, Centinul |
Hi, and welcome to LQ!
Quote:
has an mtime of 0, so will /home/am0032; hence it will all be tarred up. What happens if you add -type f to the find? Cheers, Tink |
Quote:
Quote:
Quote:
Code:
tar czvf /respaldo/today.tgz $(find ~am0032 -type f -mtime 0) Code:
find ~am0032 -type f -mtime 0 -print0 | tar czvf /respaldo/today.tgz -T - --null |
thanx a lot
the type f thing fixed it all :)
|
Glad we're not one of the worlds best Linux support
sites for nothing ;} Cheers, Tink |
All times are GMT -5. The time now is 03:01 PM. |