Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to create .tgz file without creating .tar file? Post 302720449 by bakunin on Wednesday 24th of October 2012 07:32:08 AM
Old 10-24-2012
Quote:
Originally Posted by Pawan Kumar
tar -pczf MyBackup.tar.gz <file which needs to be inside>

will above command standard?

I have only concern is that wthether the above command generates tar file temporarily then delete afterwards? or it not at all generates tar file?
"tar" is a standard command. The standard version of "tar" has no "-z" switch at all, therefore you can't expect it to be able to understand it. Only the GNU version of "tar" has this extension. Therefore the second version Corona688 told you should be preferred. It will work everywhere, including GNU systems, while your version will work ONLY on GNU systems:

Code:
tar -cf - <files/paths to be included> | gzip > /path/to/output.tgz

It is generally better not to rely on extensions to the standard but to use only what the standard defines. By "standard" i mean POSIX here.

I hope this helps.

bakunin
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

script to create tar file

hello, im a newbie in unix scripting. can someone pls send me a sample script that will tar files in the folders of a specific directory, but will exclude specific files, and afterwards, will ftp the tar into another server. for example: in this directory, pshrprod:/opt/psoft/weblogic/818sp9_80... (2 Replies)
Discussion started by: ajrandrup
2 Replies

2. Shell Programming and Scripting

Error while creating .tar file using script

Hi, I am getting following error while running script: tar: can't change directories to /home/xyz/script: No such file or directory tar: compress: No such file or directory tar: getts.tar same as archive file Following is my script: #!/bin/bash echo "You want:" echo "1. zip... (1 Reply)
Discussion started by: Rakesh Bhat
1 Replies

3. UNIX for Dummies Questions & Answers

file.tgz.1of2 & file.tgz.2of2

Hi all, Need help. Anybody seen this kind of file before? file.tgz.1of2 file.tgz.2of2 how to extract this tgz file? Any help? Tq (5 Replies)
Discussion started by: zeedwolf
5 Replies

4. UNIX for Dummies Questions & Answers

Creating a Tar file while files are spooling

Hi I have done a search for this but couldn't find much on it. I am creating a tar file with the command below tar cvf /export/home/user/backup/*Will this is being created I have a job spooling to 5 texts files in the following directory /export/home/user/backup/STATS/ The tar files... (1 Reply)
Discussion started by: sgarvan
1 Replies

5. Solaris

How to extract files from a tar file without creating the directories?

Hello all. I have a tar file that contains a number of files that are stored in different directories. If I extract this tar file with -xvf , the directories get created. Is there a way to extract all of the files into one directory without creating the directories stored in the tar file. (9 Replies)
Discussion started by: gkb
9 Replies

6. UNIX for Advanced & Expert Users

Create corrupted *.tar.gz file ?

Hello. I`m writing a bash script who archive log files and send them to backup server. I need some kind of checking mechanism for *.tar.gz files. I found something like: gunzip -t file.tar.gz //Not output from it. And for tar: tar tf file.tar.gz //Only lists archive 1.) I need make a... (3 Replies)
Discussion started by: jabalv
3 Replies

7. Shell Programming and Scripting

Create tar file

Following are the list of files available in the dataout directory a1.txt.gz a2.txt.gz b3.txt.gzStep 1: now the tar file needs to be created as follows. tar -cvf ab.tar *.gzAll the files with extn .gzg has to be bundled in the tar file. Once the tar file is created, the files which are... (9 Replies)
Discussion started by: kmanivan82
9 Replies

8. Shell Programming and Scripting

How to create tgz file for all the directories in one time?

Hi, On server there is an one folder . which contains sub folder Eg - TEST folder contains test1, test2, execr ,tt (folder). also includes some text file like abc.txt psp.txt gg.log. here iwant to create tgz file for all the folders and file in one time. I know the command... (1 Reply)
Discussion started by: aish11
1 Replies

9. Windows & DOS: Issues & Discussions

[SOLVED] Creating .tar file

Hi, How to create a .tar file in windows OS.. I need to ftp tat <filename>.tar file into AIX and untar it there and will use for futher actions.. Please help.. Thanks in advance.. (2 Replies)
Discussion started by: Priya Amaresh
2 Replies

10. AIX

How to install .tar.tgz file in AIX 6.1?

Hello, I have openssl.0.9.8.1103.tar.tgz file which I have downloaded from https://www14.software.ibm.com/webapp/iwm/web/reg/download.do?source=aixbp&S_PKG=openssl siteThe website says that the file name is openssl.0.9.8.1103.tar.z but when downloaded I get openssl.0.9.8.1103.tar.tgz as the... (2 Replies)
Discussion started by: gaugeta
2 Replies
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)
All times are GMT -4. The time now is 08:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy