The Parallel File Tools suite provides parallel versions of tar,
rm, and cp. These tools can run requests on large
file systems in parallel, maximizing performance for data protection operations.
The toolkit includes:
partar: Use this command to create and extract tarballs in parallel.
Note
The partar tool supports the extraction of tar files created in the GNU basic tar POSIX 1003.1-1990 format. Files created in other archive formats, such as PAX, are not supported.
parrm: You can use this command to recursively remove a directory
in parallel.
parcp: Use this command to recursively copy a directory in
parallel.
Installing the Parallel File Tools
The tool suite is distributed as an RPM for Oracle Linux, Red Hat Enterprise
Linux, and CentOS.
In this example, parcp is used to copy the directory "folder" in /source to /destination. The -P option is used to set the number of parallel threads you want to use.
Copy
$parcp -P 16 /source/folder /destination
In the following example, parcp is used to copy the contents of the directory "folder" in /source to /destination. The "folder" directory itself is not copied.
The following command creates a .tar archive of the contents of the specified directory, and stores it as a tarball in the directory. In the example below, the name of the directory that is being used to create the tarball is example.
Copy
$partar pcf example.tar example -P 16
You can also create a tarball and send it to a different directory. In the example below, the directory being used to create the tarball is example. The tarball is being created in the /test directory.
Copy
$partar pcf example.tar example -P 16 -C /test
Using the Tools - Advanced Examples 🔗
Here are some examples of how the different tools are used in more advanced scenarios.
Performing ls -l on /mnt/destinationdir/mytar shows that only the desired files have been copied.
Copy
[opc@example mytar]$ ls -l
total 148
-rwxr-xr-x. 1 opc opc 37 Nov 30 2017 File1.txt
-rwxr-xr-x. 1 opc opc 15 Dec 1 2017 File2.txt
-rwxr-xr-x. 1 opc opc 39 Nov 30 2017 File3.txt
-rwxr-xr-x. 1 opc opc 57 Dec 1 2017 File4.txt
When excluding a directory or file from the archive, provide only the name of the directory or file. The --exclude option does not support use of an absolute path. Using an absolute path in the --exclude option will not exclude the specified directory or files from the .tar archive. For example, if you need to exclude a directory called testing from the path of the source directory, you would specify that in a command like the following:
You can specify which files and folders are included when you use parcp to copy from one directory to another. Let's say you have a directory that looks like this:
The --restore option in parcp is similar to using the -a -r -x and -H options in rsync. (See rsync(1)- Linux Man Page.) The -P option is used to set the number of parallel threads you want to use.
The restore option includes the following behavior:
Recurse into directories
Stop at file system boundaries
Preserve hard links, symlinks, permissions, modification times, group, owners, and special files such as named sockets and fifo files
You can use parcp with the --restore and --delete options to sync files between a source and target folder. This is a good substitute for using rsync in parallel. As files are added or removed from the source directory, you can run this command at regular intervals to add or remove the same files from the destination directory. You can automate syncing by using this command option in a cron job.