Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to create .tgz file without creating .tar file? Post 302719357 by Pawan Kumar on Monday 22nd of October 2012 11:49:53 AM
Old 10-22-2012
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?
 

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
GIT-ARCHIVE(1)							    Git Manual							    GIT-ARCHIVE(1)

NAME
git-archive - Create an archive of files from a named tree SYNOPSIS
git archive [--format=<fmt>] [--list] [--prefix=<prefix>/] [<extra>] [-o <file> | --output=<file>] [--worktree-attributes] [--remote=<repo> [--exec=<git-upload-archive>]] <tree-ish> [<path>...] DESCRIPTION
Creates an archive of the specified format containing the tree structure for the named tree, and writes it out to the standard output. If <prefix> is specified it is prepended to the filenames in the archive. git archive behaves differently when given a tree ID versus when given a commit ID or tag ID. In the first case the current time is used as the modification time of each file in the archive. In the latter case the commit time as recorded in the referenced commit object is used instead. Additionally the commit ID is stored in a global extended pax header if the tar format is used; it can be extracted using git get-tar-commit-id. In ZIP files it is stored as a file comment. OPTIONS
--format=<fmt> Format of the resulting archive: tar or zip. If this option is not given, and the output file is specified, the format is inferred from the filename if possible (e.g. writing to "foo.zip" makes the output to be in the zip format). Otherwise the output format is tar. -l, --list Show all available formats. -v, --verbose Report progress to stderr. --prefix=<prefix>/ Prepend <prefix>/ to each filename in the archive. -o <file>, --output=<file> Write the archive to <file> instead of stdout. --worktree-attributes Look for attributes in .gitattributes files in the working tree as well (see the section called "ATTRIBUTES"). <extra> This can be any options that the archiver backend understands. See next section. --remote=<repo> Instead of making a tar archive from the local repository, retrieve a tar archive from a remote repository. --exec=<git-upload-archive> Used with --remote to specify the path to the git-upload-archive on the remote side. <tree-ish> The tree or commit to produce an archive for. <path> Without an optional path parameter, all files and subdirectories of the current working directory are included in the archive. If one or more paths are specified, only these are included. BACKEND EXTRA OPTIONS
zip -0 Store the files instead of deflating them. -9 Highest and slowest compression level. You can specify any number from 1 to 9 to adjust compression speed and ratio. CONFIGURATION
tar.umask This variable can be used to restrict the permission bits of tar archive entries. The default is 0002, which turns off the world write bit. The special value "user" indicates that the archiving user's umask will be used instead. See umask(2) for details. If --remote is used then only the configuration of the remote repository takes effect. tar.<format>.command This variable specifies a shell command through which the tar output generated by git archive should be piped. The command is executed using the shell with the generated tar file on its standard input, and should produce the final output on its standard output. Any compression-level options will be passed to the command (e.g., "-9"). An output file with the same extension as <format> will be use this format if no other format is given. The "tar.gz" and "tgz" formats are defined automatically and default to gzip -cn. You may override them with custom commands. tar.<format>.remote If true, enable <format> for use by remote clients via git-upload-archive(1). Defaults to false for user-defined formats, but true for the "tar.gz" and "tgz" formats. ATTRIBUTES
export-ignore Files and directories with the attribute export-ignore won't be added to archive files. See gitattributes(5) for details. export-subst If the attribute export-subst is set for a file then Git will expand several placeholders when adding this file to an archive. See gitattributes(5) for details. Note that attributes are by default taken from the .gitattributes files in the tree that is being archived. If you want to tweak the way the output is generated after the fact (e.g. you committed without adding an appropriate export-ignore in its .gitattributes), adjust the checked out .gitattributes file as necessary and use --worktree-attributes option. Alternatively you can keep necessary attributes that should apply while archiving any tree in your $GIT_DIR/info/attributes file. EXAMPLES
git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -) Create a tar archive that contains the contents of the latest commit on the current branch, and extract it in the /var/tmp/junk directory. git archive --format=tar --prefix=git-1.4.0/ v1.4.0 | gzip >git-1.4.0.tar.gz Create a compressed tarball for v1.4.0 release. git archive --format=tar.gz --prefix=git-1.4.0/ v1.4.0 >git-1.4.0.tar.gz Same as above, but using the builtin tar.gz handling. git archive --prefix=git-1.4.0/ -o git-1.4.0.tar.gz v1.4.0 Same as above, but the format is inferred from the output file. git archive --format=tar --prefix=git-1.4.0/ v1.4.0^{tree} | gzip >git-1.4.0.tar.gz Create a compressed tarball for v1.4.0 release, but without a global extended pax header. git archive --format=zip --prefix=git-docs/ HEAD:Documentation/ > git-1.4.0-docs.zip Put everything in the current head's Documentation/ directory into git-1.4.0-docs.zip, with the prefix git-docs/. git archive -o latest.zip HEAD Create a Zip archive that contains the contents of the latest commit on the current branch. Note that the output format is inferred by the extension of the output file. git config tar.tar.xz.command "xz -c" Configure a "tar.xz" format for making LZMA-compressed tarfiles. You can use it specifying --format=tar.xz, or by creating an output file like -o foo.tar.xz. SEE ALSO
gitattributes(5) GIT
Part of the git(1) suite Git 1.8.3.1 06/10/2014 GIT-ARCHIVE(1)
All times are GMT -4. The time now is 10:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy