Operating System - HP-UX
1843756 Members
2906 Online
110223 Solutions
New Discussion

Is it safe to combine tar and pax in backup scripts on HP-UX 11?

 
Indeleble
Occasional Visitor

Is it safe to combine tar and pax in backup scripts on HP-UX 11?

Hello everyone,

I’m working on a backup script for HP-UX 11 and I have a question about compatibility and best practices.

Currently, my workflow looks like this:

  1. I use tar to create an archive of the system files (with certain exclusions).
  2. Then I use pax to handle lists and more flexible formats, especially when I need support for large files.

The idea is something like:

 
find . | grep -v "directories_to_exclude" | pax -w -x pax > backup.tar
 
 

But in some cases, I’ve seen people use tar first and then compress or process with pax.

Questions:

  • Does it make sense to combine tar and pax in the same workflow?
  • Are there any risks of incompatibility between formats (e.g., classic tar vs pax)?
  • What’s the best practice on HP-UX for large backups (files > 8 GB) and complex exclusions?

Thanks for any guidance or experience you can share!

2 REPLIES 2
yesheswini_s
HPE Pro

Re: Is it safe to combine tar and pax in backup scripts on HP-UX 11?

Hi @Indeleble ,

Yes, it is generally safe to use both tar and pax in backup scripts on HP-UX 11, but you need to be mindful of differences in features, portability, and archive format compatibility. tar is widely supported and simple, while pax is more modern, POSIX-compliant, and better at handling long filenames and extended attributes. Mixing them is fine as long as you clearly define which tool creates archives and which extracts them, and you avoid relying on features unique to one tool.
Also consider these risks before using the tar and pax in backup scripts:
1. Format mismatch: If you create an archive with pax using extended attributes, extracting with tar may lose metadata.
2. Script complexity: Mixing tools can confuse future maintainers. It’s best to standardize on one tool unless you have a clear reason.
3. Performance: tar is slightly faster for simple backups, while pax is more robust for complex directory structures.
Best Practices:
1. Use pax for creating archives if you need portability and long filename support.
2. Use tar for simple, legacy-compatible backups where speed matters more than metadata.
3. If combining them, document clearly which tool is used for which step (e.g., pax for creation, tar for extraction).
4. Test your backup and restore process thoroughly to ensure no data or attributes are lost.

Thank You!
I work with HPE but opinions expressed here are mine.
HPE Tech Tips videos on How To and Troubleshooting topics



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
support_s
System Recommended

Query: Is it safe to combine tar and pax in backup scripts on HP-UX 11?

System recommended content:

1. Open System Services System Calls Reference Manual

2. Ignite-UX Release Notes HP-UX 11iv1, HP-UX 11iv2, and HP-UX 11iv3 (5900-3360, November 2013)

 

Please click on "Thumbs Up/Kudo" icon to give a "Kudo".

 

Thank you for being a HPE valuable community member.


Accept or Kudo