gpt4 book ai didi

kubernetes - kubectl cp "error: one of src or dest must be a remote file specification"

转载 作者:行者123 更新时间:2023-12-02 11:46:39 31 4
gpt4 key购买 nike

当我尝试使用通配符复制现有目录中的某些文件时,收到错误消息:

kubectl cp localdir/* my-namespace/my-pod:/remote-dir/
error: one of src or dest must be a remote file specification

看起来通配符支持已被删除,但我有很多文件要复制,而且我的远程目录不是空的,所以我不能使用递归。

我怎样才能运行类似的操作?

最佳答案

作为解决方法,您可以使用:

find localdir/* | xargs -I{} kubectl cp {} my-namespace/my-pod:/remote-dir/
在 find 中,您可以使用通配符来指定您要查找的文件,它会将其复制到 pod。

关于kubernetes - kubectl cp "error: one of src or dest must be a remote file specification",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61632490/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com