如何解决 AIX tar 命令套接字错误?

发布于 07-08 11:28 字数 715 浏览 6 评论 0原文

在 AIX 环境中工作时,我发出以下 tar 命令并在套接字上接收错误。

问题1. 如何避免套接字错误?

问题 2. 我可以依赖 tar 文件来包含除错误文件之外的所有文件吗?

 $ 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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

べ映画2024-07-15 11:28:51
  1. 您应该避免包含绝对路径 - GNU tar 自动执行此操作。 这使得恢复到 /xyz 可能已经存在并且可能不应该被篡改的其他计算机上变得困难。
  2. 您可能不应该在根目录中写入 - 这是一个不好的做法。
  3. AIX tar 支持选项 -X 来排除文件; 如果您可以列出要排除的文件,那么它就会起作用。
  4. 它还有用于处理特殊文件的选项-d

    光盘 /

    查找 xyz -type s -print > /tmp/xx

    tar -cvf /tmp/post_patches.tar -X /tmp/xx

    rm -f /tmp/xx

这确保所有套接字文件都列在 /tmp/xx 中; 它们将通过 -X 选项从备份中排除。

  1. You should probably avoid including the absolute path - GNU 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.
  2. You probably should not be writing in the root directory - it is a bad practice to get into.
  3. AIX tar has support for option -X to exclude files; if you can list the files to be excluded, it will work.
  4. 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.

挽清梦2024-07-15 11:28:51

我手边没有 AIX 来查看,但 Mac OSX 上的“tar”支持“--ignore-failed-read”开关。 你看过了吗?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文