02-06-2008
'find' and 'tar' combination
I'm trying to tar the files I get from the 'find' command result. However I can't make it run successfuly? This is for our archiving process.
Here is my script:
find /mnt/LOGS -mtime -10 -name "TUXLOG.*" -exec tar -cvf /mnt/LOGS/combine.tar {} \;
Im not sure why it is not working or it is even possible to use the 'tar' command with exec.
Appreciate your help.
10 More Discussions You Might Find Interesting
1. Solaris
Hello
I'm trying to use a combination of gunzip and tar to unpack and unzip a *.tar.gz file. I tried gunzip ~/myfile.tar.gz | gtar -x
This will unzip the file, but it won't unpack. Any hints?
thanks a lot
Dan (5 Replies)
Discussion started by: dwidmer
5 Replies
2. UNIX for Dummies Questions & Answers
When I am doing the first command the result shows all the files, links, directories except the ones that contain the word logs
find . -type f -o -type l -o -type d | grep -v logs
But when I am trying to do this even the logs are getting tarred
tar -cvf fdtvision.tar `find . -type f -o -type l... (2 Replies)
Discussion started by: venu_nbk
2 Replies
3. UNIX for Dummies Questions & Answers
Dear all,
I have to calculate sum of record count of files of the specified directory.
First I tried the following way which prints one or more outputs.
How can I sum of this output?
find /home/work/tmp/1/O/ -type f -print0 | xargs -0 wc -l | grep total
1666288 total
1073908 total
... (4 Replies)
Discussion started by: mr_bold
4 Replies
4. UNIX for Dummies Questions & Answers
Hello All,
I'm trying the following:find . -name "*" -exec grep -ln "IsAlpha" {} \;
It gives me file names only (having string "IsAlpha"), I want to get line numbers also, something like this: test 1: Line 52
test 1: Line 95 etc
Is it possible to obtain using grep & find only. (5 Replies)
Discussion started by: nervous
5 Replies
5. UNIX for Dummies Questions & Answers
Hi all,
4 files are returned when i issue 'find . -mtime -1 -type f -ls'.
./ora_475244.aud
./ora_671958.aud
./ora_934052.aud
./ora_934050.aud
However, when I issued the below command:
tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies
6. Shell Programming and Scripting
Hi all,
I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies
7. Shell Programming and Scripting
test.txt is the dynamic file but some of combination are fix
like below are the lines
;wonder_off =
;wonder_off = disabled
wonder_off =
wonder_off = disabled
the test.txt can content them in any order
#cat test.xt
;wonder_off =
;wonder_off = disabled
wonder_off =
wonder_off =... (5 Replies)
Discussion started by: SilvesterJ
5 Replies
8. Shell Programming and Scripting
Hi all,
I have created a function that looks for a folder in a particular directory, checks the date it was last modified and if its old then compress it.
This works fine for files using gzip. However for folders I had to use tar. This is my function:
compressOldFolder()
{
# $1 is... (10 Replies)
Discussion started by: TasosARISFC
10 Replies
9. Shell Programming and Scripting
Hi,
I'm trying to use find in kshell (AIX) to find all files with perms of
write for other
AND
any execute bit set.
e.g:
r--r-x-w- would qualify
and rw-rw--wx would qualify
but ---rwxr-xr-x wouldn't qualify
So far, I've been trying something like this:
find . -type f -perm... (4 Replies)
Discussion started by: alanp36
4 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I need to combined in 1 line the execution below :
find * -type f -mtime -$nb_days -print | xargs tar -cvf $MAITUT/BCK_DATA.tar
gzip $MAITUT/BCK_DATA.tar.gz
The fact that the TAR is very big, at the end I need to generate only the GZ file.
The option z on the tar... (2 Replies)
Discussion started by: royinfo.alain
2 Replies
LEARN ABOUT SUSE
virt-tar-in
virt-tar-in(1) Virtualization Support virt-tar-in(1)
NAME
virt-tar-in - Unpack a tarball into a virtual machine disk image.
SYNOPSIS
virt-tar-in -a disk.img data.tar /destination
virt-tar-in -d domain data.tar /destination
zcat data.tar.gz | virt-tar-in -d domain - /destination
WARNING
Using "virt-tar-in" on live virtual machines can be dangerous, potentially causing disk corruption. The virtual machine must be shut down
before you use this command.
DESCRIPTION
"virt-tar-in" unpacks an uncompressed tarball into a virtual machine disk image or named libvirt domain.
The first parameter is the tar file. Use "-" to read the tar file from standard input. The second parameter is the absolute target
directory to unpack into.
EXAMPLES
Upload a home directory to a guest:
virt-tar-in -d MyGuest homes.tar /home
JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH
This command is just a simple shell script wrapper around the guestfish(1) "tar-in" command. For anything more complex than a trivial
copy, you are probably better off using guestfish directly.
OPTIONS
Since the shell script just passes options straight to guestfish, read guestfish(1) to see the full list of options.
SEE ALSO
guestfish(1), virt-cat(1), virt-copy-in(1), virt-copy-out(1), virt-edit(1), virt-make-fs(1), virt-tar-out(1), <http://libguestfs.org/>.
AUTHORS
Richard W.M. Jones ("rjones at redhat dot com")
COPYRIGHT
Copyright (C) 2011 Red Hat Inc. <http://libguestfs.org/>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
libguestfs-1.18.1 2013-12-07 virt-tar-in(1)