Mac 使用 tar 工具压缩到Linux 解压出现警告

Laravel China 社区 · · 289 次点击 · · 开始浏览    

在Linux 执行 tar xzf *.tar.gz 出现如下警告

Ignoring unknown extended header keyword

问题描述:

tar: Ignoring unknown extended header keyword `SCHILY.fflags'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.FinderInfo'
tar: Ignoring unknown extended header keyword `SCHILY.fflags'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.FinderInfo'
tar: Ignoring unknown extended header keyword `SCHILY.fflags'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.quarantine'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.lastuseddate#PS'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.quarantine'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.lastuseddate#PS'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.quarantine'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.lastuseddate#PS'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.quarantine'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.lastuseddate#PS'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.quarantine'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.lastuseddate#PS'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.quarantine'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.lastuseddate#PS'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.quarantine'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.lastuseddate#PS'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.quarantine'
tar: Ignoring unknown extended header keyword `LIBARCHIVE.xattr.com.apple.lastuseddate#PS'

打包为Mac OS 上进行

tar -czf "${tar_file}" \
--no-xattrs \
--exclude="${env_dump_path}" \
--exclude="${api_log_path}" \
--exclude="$console_log_path" \
--exclude="$git_path" \
--exclude="$ds_store_file" \
--exclude="$api_ds_store_file" \
--exclude="$api_runtime_ds_store_file" \
--exclude="$idea_file" \
 "${code_dir}"

在打包时候 加上选项 --no-xattrs 屏蔽属性打包上去,再去服务器执行都正常了

Scp 指令

- Copy a local file to a remote host:
    scp path/to/local_file remote_host:path/to/remote_file

- Use a specific port when connecting to the remote host:
    scp -P port path/to/local_file remote_host:path/to/remote_file

- Copy a file from a remote host to a local directory:
    scp remote_host:path/to/remote_file path/to/local_directory

- Recursively copy the contents of a directory from a remote host to a local directory:
    scp -r remote_host:path/to/remote_directory path/to/local_directory

- Copy a file between two remote hosts transferring through the local host:
    scp -3 host1:path/to/remote_file host2:path/to/remote_directory

- Use a specific username when connecting to the remote host:
    scp path/to/local_file remote_username@remote_host:path/to/remote_directory

- Use a specific ssh private key for authentication with the remote host:
    scp -i ~/.ssh/private_key local_file remote_host:/path/remote_file

平时常用指令是
scp -rp source root@IP:/root/ -r 代表递归

本作品采用《CC 协议》,转载必须注明作者和本文链接
每天一点小知识,到那都是大佬,哈哈

本文来自:Laravel China 社区

感谢作者:Laravel China 社区

查看原文:Mac 使用 tar 工具压缩到Linux 解压出现警告

289 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传