Reputation:
Working in an AIX environment, I'm issuing the following tar command and receive errors on sockets.
Question 1. How can I avoid the socket errors?
Question 2. Can I rely on the tar file to contain all files excluding the ones 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
Upvotes: 1
Views: 2592
Reputation: 754520
tar
does that automatically. It makes it hard to restore onto other machines where the /xyz
may already exist and perhaps should not be tampered with.-X
to exclude files; if you can list the files to be excluded, it will work.It also has option -d
for dealing 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 by the -X option.
Upvotes: 1
Reputation: 10502
I don't have AIX at hand to take a look, but the 'tar' on Mac OSX supports the '--ignore-failed-read' switch. Have you taken a look at it?
Upvotes: 0