How do I troubleshoot socket errors in AIX tar?
While working on AIX environment, I issue the following tar command and get socket errors.
Question 1. How can I avoid socket errors?
Question 2. Can I rely on a tar file that contains all files except those that were in error?
$ tar -cvf /post_patches.tar /xyz
tar: /xyz/runtime/splSock6511 could not be archived
tar: /xyz/runtime/splSock6507 could not be archived
tar: /xyz/runtime/splSock6510 could not be archived
tar: /xyz/runtime/splSock6506 could not be archived
$ ls -asl spl*
0 srwxrwxrwx 1 myuser myuser 0 Nov 19 09:41 splSock6506
0 srwxrwxrwx 1 myuser myuser 0 Nov 19 09:41 splSock6507
0 srwxrwxrwx 1 myuser myuser 0 Nov 18 14:19 splSock6510
0 srwxrwxrwx 1 myuser myuser 0 Nov 18 14:19 splSock6511
+1
Ken
source
to share
2 answers
- You should probably avoid including an absolute path - GNU
tar
does this automatically. This makes it difficult to recover on other machines where it/xyz
might already exist and might not need to be tampered with. - You probably shouldn't write in the root directory - that's bad practice.
- AIX tar supports an option
-X
to exclude files; if you can list the files to be excluded it will work. -
It also has the option
-d
to work with special files.cd /
find xyz-type s -print> / tmp / xx
tar -cvf / tmp / post_patches.tar -X / tmp / xx
rm -f / tmp / xx
This ensures that any socket files are listed in / tmp / xx; they will be excluded from the backup using the -X option.
+1
source to share