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.
Packing small files locally and upload
Having too many small files on the Archive can affect the system's performance, and sometimes it is more convenient to pack the data locally and upload the tarball directly.
This can be done in a single command, creating a tarball directly on the archive, without first having to compress the files locally. To do this, collect all the files in a folder and then, from the folder, run:
With this command, the "archive.tar" file is created directly on the archive, not the local machine.
Sometimes, file and folder attributes get included in the tar file, which can give errors. To avoid this, the option
can be included. So, the full command will be:
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: