Shamelessuk
asked on
AIX 5.2 tar -X to exclude a directory
Hi,
I would like to exclude a directory from my tar of /usr/sap/trans backup.
i have tried using the -X option (as specified in the man pages), but the option is not recognised when it is in the command.
The command I am trying to run is:
tar -cvf trans.tar /usr/sap/trans -X /usr/sap/trans/<dir_to_exc lude>
The system does not like the -X option.
Any ideas?
Cheers,
ShamelessUK
I would like to exclude a directory from my tar of /usr/sap/trans backup.
i have tried using the -X option (as specified in the man pages), but the option is not recognised when it is in the command.
The command I am trying to run is:
tar -cvf trans.tar /usr/sap/trans -X /usr/sap/trans/<dir_to_exc
The system does not like the -X option.
Any ideas?
Cheers,
ShamelessUK
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@woolmilkporc:
> Hi ShamelessUK,
> you're right, tar as shipped with AIX 5.2 doesn't honour the -X option.
I am afraid this is not correct. -X option is supported by AIX V 5.2 an up. Furthermore if it did not accept the switch it would print a nag line such as:
tar: illegal option -- X
> Hi ShamelessUK,
> you're right, tar as shipped with AIX 5.2 doesn't honour the -X option.
I am afraid this is not correct. -X option is supported by AIX V 5.2 an up. Furthermore if it did not accept the switch it would print a nag line such as:
tar: illegal option -- X
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Will you post the output of tar command (I mean the usage info when you type just tar on a line)? also the output of oslevel -r ?
Should be similar to this:
Usage: tar -{c|r|t|u|x} [ -BdDEFhilmopRsUvw ] [ -Number ] [ -f TarFile ]
[ -b Blocks ] [ -S [ Feet ] | [ Feet@Density ] | [ Blocksb ] ]
[ -L InputList ] [-X ExcludeFile] [ -N Blocks ] [ -C Directory ] File ...
Usage: tar {c|r|t|u|x} [ bBdDEfFhilLXmNopRsSUvw[0-9 ] ]
[ Blocks ] [ TarFile ] [ InputList ] [ ExcludeFile ]
[ [ Feet ] | [ Feet@Density ] | [ Blocksb ] ] [-C Directory ] File ...
Should be similar to this:
Usage: tar -{c|r|t|u|x} [ -BdDEFhilmopRsUvw ] [ -Number ] [ -f TarFile ]
[ -b Blocks ] [ -S [ Feet ] | [ Feet@Density ] | [ Blocksb ] ]
[ -L InputList ] [-X ExcludeFile] [ -N Blocks ] [ -C Directory ] File ...
Usage: tar {c|r|t|u|x} [ bBdDEfFhilLXmNopRsSUvw[0-9
[ Blocks ] [ TarFile ] [ InputList ] [ ExcludeFile ]
[ [ Feet ] | [ Feet@Density ] | [ Blocksb ] ] [-C Directory ] File ...
gnu tar here, command gtar after installing.
ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/tar/tar-1.14-2.aix5.1.ppc.rpm
ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/tar/tar-1.14-2.aix5.1.ppc.rpm
ASKER
Thanks guys. I had to tar individual directories in the end as it was a customer system and they removed my root access shortly after I posted the question - thus killing my attempts to try out the solutions suggested. That said, I have tried them out on a different machine and all seemed to work as expected.
Thanks again,
Shamelessuk
Thanks again,
Shamelessuk
If it goes routine try gnu tar - remember that normal AIX tar will not be able to open files (7-zip or tar on linux/bsd will open them)
you're right, tar as shipped with AIX 5.2 doesn't honour the -X option.
How about upgrading to 5.3?
OK, seriously, you can use the tar contained in the AIX toolbox or here -
http://www.perzl.org/aix/index.php?n=Main.Tar
Download it, install using 'rpm -i tar-1.22-1.aix5.1.ppc.rpm'
and call it by '/opt/freeware/bin/tar ......' with the remaining parameters as in your Q.
If, for some reason, there was no possibility for you to install that tar version, we could construct an 'include' file, use of which is supported with your tar.
For that construction we need to know your exclusion criteria. Perhaps we can then work out something useful.
Good luck!
wmp