Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to tar a directory in AIX? Post 302898918 by sayami00 on Friday 25th of April 2014 02:52:52 AM
Old 04-25-2014
it will work for both file and directory .

Code:
>ls -altr
total 8
drwxr-x---   12 abc      123           4096 Apr 25 12:31 ..
-rw-r-----    1 abc      123              0 Apr 25 12:31 tarfile.txt
drwxr-x---    2 abc      123            256 Apr 25 12:31 tardir
drwxr-x---    3 abc      123            256 Apr 25 12:31 .
>tar -cvf - tarfile.txt | gzip -c > tarfile.tar.gz
a tarfile.txt 0 blocks
>tar -cvf - tardir | gzip -c > tardir.tar.gz
a tardir
>ls -altr
total 24
drwxr-x---   12 abc      123           4096 Apr 25 12:31 ..
-rw-r-----    1 abc      123              0 Apr 25 12:31 tarfile.txt
drwxr-x---    2 abc      123            256 Apr 25 12:31 tardir
-rw-r-----    1 abc      123            400 Apr 25 12:31 tarfile.tar.gz
-rw-r-----    1 abc      123            398 Apr 25 12:32 tardir.tar.gz
drwxr-x---    3 abc      123            256 Apr 25 12:32 .

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

tar directory

Hello I try to tar a directory but I get this message # tar cvfb my directory prox.tar tar: invalid blocksize "prox.tar". What Im doing wrong. Solaris 5.6 And other question change this command with another version of solaris Thanks in advance (1 Reply)
Discussion started by: lo-lp-kl
1 Replies

2. AIX

AIX 4.2: tar using compression ?

Hi, is there a way to use compression on the TAR command running on a AIX 4.2 ? I did a "man tar" but did not see mentions of using compression, nor how to even find out the tar version. I want to look into ways of reducing the amount of time to do backups. One backup is dumping database... (9 Replies)
Discussion started by: Browser_ice
9 Replies

3. Shell Programming and Scripting

tar the entire directory except one directory

Hi All, I need to tar the entire directory except one directory inside that. I have used the below command tar -cvfX test.tar bin/perl bin/ I need to tar all the directories inside the bindirectory except the perl directory Please help me in solving this :b: Regards, Kalai (4 Replies)
Discussion started by: kalpeer
4 Replies

4. Shell Programming and Scripting

tar command dont tar to original directory

HI, if I have a tarfile called pmapdata.tar that contains tar -tvf pmapdata.tar -rw-r--r-- 0/0 21 Oct 15 11:00 2009 /var/tmp/pmapdata/pmap4628.txt -rw-r--r-- 0/0 21 Oct 14 20:00 2009 /var/tmp/pmapdata/pmap23752.txt -rw-r--r-- 0/0 1625 Oct 13 20:00 2009... (1 Reply)
Discussion started by: borderblaster
1 Replies

5. UNIX for Dummies Questions & Answers

tar directory -C

I m new to unix and trying to use tar command with -C option - tar -cf /tmp/Test_shell/ZipTestFolder/archive10.tar -C /tmp/Test_shell/ZipTestFolder/ . It creates one more folder no_name inside the tar file. any suggestions how to remove it. I m using aix 5.3 (8 Replies)
Discussion started by: abhishek1.618
8 Replies

6. UNIX for Advanced & Expert Users

How to rsync or tar directory trees, with hidden directory, but without files?

I want to backup all the directory tress, including hidden directories, without copying any files. find . -type d gives the perfect list. When I tried tar, it won't work for me because it tars all the files. find . -type d | xargs tar -cvf a.tar So i tried rsync. On my own test box, the... (4 Replies)
Discussion started by: fld2007
4 Replies

7. Shell Programming and Scripting

Tar of directory

i have a 10 directory in my path i have to take a tar of 7 directory without link files and also have to exclude those 3 directory. tar -cvzf /path/file_name.tar.gz directoryname please help!! facing problem in excluding links file (4 Replies)
Discussion started by: joy lobo
4 Replies

8. AIX

Making Tar of directory and tar file is going to be placed

Quick question, is it possible to make a Tar of completely directory and placing the tar file in it (will this cause even the tar file to tarred ?) sample: /opt/freeware/bin/tar -cvf - /oracle | gzip > /oracle/backup.tgz will the tar file backup.tgz also include backup.tgz ? i tried... (5 Replies)
Discussion started by: filosophizer
5 Replies

9. AIX

GNU TAR vs NATIVE AIX TAR

Hello, Getting this very strange error, made tar/zip through gnu tar GNU Tar ( successful tar and zip without any errors ) /opt/freeware/bin/tar cvf - /oraapp| gzip > /backup/bkp_15_6_16_oraapp.tgz GNU unTar error root@test8:/>gunzip < /config1/bkp_15_6_16_oraapp.tgz |... (5 Replies)
Discussion started by: filosophizer
5 Replies

10. AIX

Samba 3.6 on AIX 7.1 - Windows 10 Access to AIX file shares using Active Directory authentication

I am running AIX 7.1 and currently we have samba 3.6.25 installed on the server. As it stands some AIX folders are shared that can be accessed by certain Windows users. The problem is that since Windows 10 the guest feature no longer works so users have to manually type in their Windows login/pwd... (14 Replies)
Discussion started by: linuxsnake
14 Replies
GIT-TAR-TREE(1) 						    Git Manual							   GIT-TAR-TREE(1)

NAME
git-tar-tree - Create a tar archive of the files in the named tree object SYNOPSIS
git tar-tree [--remote=<repo>] <tree-ish> [ <base> ] DESCRIPTION
THIS COMMAND IS DEPRECATED. Use git archive with --format=tar option instead (and move the <base> argument to --prefix=base/). Creates a tar archive containing the tree structure for the named tree. When <base> is specified it is added as a leading path to the files in the generated tar archive. git tar-tree 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 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. It can be extracted using git get-tar-commit-id. OPTIONS
<tree-ish> The tree or commit to produce tar archive for. If it is the object name of a commit object. <base> Leading path to the files in the resulting tar archive. --remote=<repo> Instead of making a tar archive from local repository, retrieve a tar archive from a remote repository. 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. EXAMPLES
git tar-tree HEAD junk | (cd /var/tmp/ && tar xf -) Create a tar archive that contains the contents of the latest commit on the current branch, and extracts it in /var/tmp/junk directory. git tar-tree v1.4.0 git-1.4.0 | gzip >git-1.4.0.tar.gz Create a tarball for v1.4.0 release. git tar-tree v1.4.0^{tree} git-1.4.0 | gzip >git-1.4.0.tar.gz Create a tarball for v1.4.0 release, but without a global extended pax header. git tar-tree --remote=example.com:git.git v1.4.0 >git-1.4.0.tar Get a tarball v1.4.0 from example.com. git tar-tree HEAD:Documentation/ git-docs > git-1.4.0-docs.tar Put everything in the current head's Documentation/ directory into git-1.4.0-docs.tar, with the prefix git-docs/. GIT
Part of the git(1) suite Git 1.7.10.4 11/24/2012 GIT-TAR-TREE(1)
All times are GMT -4. The time now is 11:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy