Sponsored Content
Full Discussion: tar & Grep together
Top Forums UNIX for Dummies Questions & Answers tar & Grep together Post 302110904 by tom123 on Friday 16th of March 2007 07:35:20 AM
Old 03-16-2007
Still dosnt work.
This is what happens with no zipped files in directory:

Code:
root@infocentre> ls
0               archive_backup  results.sh      test.log
root@infocentre>
root@infocentre>
root@infocentre> ./results.sh

Are the files zipped? (y/n)
y

What is the zip file extension? (tgz, zip, etc...)
tgz

There are no files to unzip in this directory!


root@infocentre>


And with zipped files in directory:

Code:
root@infocentre> ls
apache_live_2007_01_01_1.tgz  apache_live_2007_01_08_1.tgz  apache_live_2007_01_15_1.tgz  apache_live_2007_01_22_1.tgz  apache_live_2007_01_29_1.tgz
apache_live_2007_01_02_1.tgz  apache_live_2007_01_09_1.tgz  apache_live_2007_01_16_1.tgz  apache_live_2007_01_23_1.tgz  apache_live_2007_01_30_1.tgz
apache_live_2007_01_03_1.tgz  apache_live_2007_01_10_1.tgz  apache_live_2007_01_17_1.tgz  apache_live_2007_01_24_1.tgz  apache_live_2007_01_31_1.tgz
apache_live_2007_01_04_1.tgz  apache_live_2007_01_11_1.tgz  apache_live_2007_01_18_1.tgz  apache_live_2007_01_25_1.tgz  archive_backup
apache_live_2007_01_05_1.tgz  apache_live_2007_01_12_1.tgz  apache_live_2007_01_19_1.tgz  apache_live_2007_01_26_1.tgz  results.sh
apache_live_2007_01_06_1.tgz  apache_live_2007_01_13_1.tgz  apache_live_2007_01_20_1.tgz  apache_live_2007_01_27_1.tgz  test.log
apache_live_2007_01_07_1.tgz  apache_live_2007_01_14_1.tgz  apache_live_2007_01_21_1.tgz  apache_live_2007_01_28_1.tgz
root@infocentre>
root@infocentre>
root@infocentre>
root@infocentre> ./results.sh

Are the files zipped? (y/n)
y

What is the zip file extension? (tgz, zip, etc...)
tgz

There are no files to unzip in this directory!


root@infocentre>

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find & tar execution problem

I'm trying to set up a stanard sh script that will find all the files that have been changed within the last day and then tar them up. I think the command line should be something like : find /home/bob -atime +0 -exec \ tar cvf /home/bob/files.tar {}\; Help please ... Thanx (3 Replies)
Discussion started by: ianf
3 Replies

2. UNIX for Dummies Questions & Answers

disaster recover w/tar & find

Hi, I am creating a disaster recovery plan for my Linux 7.2 machine. I have two backups from my current machine. One created using the command tar -cvpf /dev/st0 --exclude=/proc --directory / . and one created with the command find / /boot /home -mount -path '/proc' -prune -o -print |... (4 Replies)
Discussion started by: jeremiebarber
4 Replies

3. UNIX for Advanced & Expert Users

grep for a tar File

Hello, I made a tar with a lot of file, and i deleted all the Files. So to win tile I want to make a grep of this tar file to search any text . Is there a Unix command available for this ? I tried : grep xyz file.tar but there is nothing . Thanks for your help.... (1 Reply)
Discussion started by: steiner
1 Replies

4. Shell Programming and Scripting

Script for tar and zip based on month & year

Hi Friends, I'm doing on script which finds all the files with time stamp and makes them tar and zip, based on their respective month&year. for instance "mar-2004.tar.zip" will contain all the files which was created/accessed/modified on mar-2004. like this the entire filesystem should be taken... (1 Reply)
Discussion started by: tuxfello
1 Replies

5. Solaris

Tar & Tape drive without media

Hi all, I would like to know what would happen if the tape (media) is not placed on the drive and a tar command is executed to backup on the tape. My problem is that tar command hanged for multiple days instead of throwing the error, Is it valid behaviour? I was unable to test the... (4 Replies)
Discussion started by: jmsathish
4 Replies

6. UNIX for Dummies Questions & Answers

Difference between grep, egrep & grep -i

Hi All, Please i need to know the difference between grep, egrep & grep -i when used to serach through a file. My platform is SunOS 5.9 & i'm using the korn shell. Regards, - divroro12 - (2 Replies)
Discussion started by: divroro12
2 Replies

7. Shell Programming and Scripting

Using Grep & find & while read line in a script

Hello people! I would like to create one script following this stage I have one directory with 100 files File001 File002 ... File100 (This is the format of content of the 100 files) 2012/03/10 12:56:50:221875936 1292800448912 12345 0x00 0x04 0 then I have one... (0 Replies)
Discussion started by: Abv_mx81
0 Replies

8. Shell Programming and Scripting

help with tar & zip only last months(say,Sep) files

Need to 1. archive all the files in a directory from the previous month into a tar/gz file, ignoring all already archived 'tar.gz' files 2. Check created .tar.gz file isnt corrupted and has all the required files in it. and then remove the original files. I am using a function to get the... (1 Reply)
Discussion started by: Prev
1 Replies

9. AIX

AIX & TAR related stuff

This thread is about using tar & other compression utilities on AIX ; 1. Find out which version of tar you are using thanks to bakunin >what $(which tar) /usr/bin/tar: 61 1.14 src/bos/usr/ccs/lib/libc/__threads_init.c, libcthrd, bos53 0 7/11/00 12:04:14 10 ... (21 Replies)
Discussion started by: filosophizer
21 Replies

10. UNIX for Dummies Questions & Answers

Grep through a .tar file without untarring it

Hi All, I need to grep through a .tar file without untarring it. Would you please help me with that ? The extension to this request is to use the cut command to extract the data from a particular field. Appreciate your quick look around (8 Replies)
Discussion started by: sanjaydubey2006
8 Replies
virt-tar-out(1) 					      Virtualization Support						   virt-tar-out(1)

NAME
virt-tar-out - Pack a virtual machine disk image directory into a tarball. SYNOPSIS
virt-tar-out -a disk.img /dir files.tar virt-tar-out -d domain /dir files.tar virt-tar-out -d domain /dir - | gzip --best > files.tar.gz DESCRIPTION
"virt-tar-out" packs a virtual machine disk image directory into a tarball. The first parameter is the absolute path of the virtual machine directory. The second parameter is the tar file to write. Use "-" to write to standard output. EXAMPLES
Download the home directories from a guest: virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH
This command is just a simple shell script wrapper around the guestfish(1) "tar-out" 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-tar-in(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-out(1)
All times are GMT -4. The time now is 09:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy