Occasionally dmftar will not be accessible or appropriate for packing the data. Here we provide some instructions on using tar as an alternative. Unlike dmftar, tar does not allow remote transfer of the data nor packing verification.
Default Packing
Pack all files in a folder into a single file:
tar cvf /archive/<login>/<workdir>/<output>.tar <folder>*
The option 'c
' indicates the creation of a new archive file which contains all of the files in the folder and 'f
' specifies the location of said file. The 'v
' provides a verbose output to the user.
Packing too large (>1TB) files using tar into 100GB chunks:
tar -M -L 100GB cvf /archive/<login>/<workdir>/<output>.tar <folder>*
Where ‘-M
’ indicates that this a multivolume archive file and ‘-L
’ to split it into 100GB chunks.
Preview the Contents of a Packed File
To see a list of the files that have been packed into an archive file:
Unpack All Files
How to unpack all the files in a standard ‘*.tar
’ folder:
cd $HOME/workdir
dmget -a <output>*
tar xvf /archive/<login>/<workdir>/<output>.tar
Where ‘x
’ indicates the extraction of the files from the archive file and 'f
' the location of the archive file. The 'v' provides a verbose output to the user. The dmget
command recalls files from the tape storage to the staging area (more details about the dmget and other DMF commands can be found within their respective documentation pages).
To unpack a multivolume archive tar file, simply point to the first file in the series without any additional arguments.
Unpack Specific Files and Folders
To unpack a single file (i.e. data1-1.dat) provide an extraction pattern containing the file name and path:
tar -xvf <output>.tar <data>/<data1>/data1-1.dat
To unpack a subdirectory (e.g. data1):
tar --extract –-file=<output>.tar <data>/<data1>
Wildcards can also used if the option '--wildcards
' and '-no-anchored
' is used to indicate the presence of wildcards:
tar -xf <output>.tar --wildcards –no-anchored ‘*.dat’
This command will unpack all the php files.
Removing Packed files
Unlike dmftar, these files will not automatically be read-only so a standard command will work: