gpt4 book ai didi

linux - Linux 中的 remote_file 使用 Windows 共享

转载 作者:太空宇宙 更新时间:2023-11-04 10:43:50 25 4
gpt4 key购买 nike

我正在尝试使用 Windows 共享来复制文件。它在 Windows 中工作正常,而当我在 Linux 中使用它时出现错误。

remote_file 'download' do 
source 'file:////server/repo/client.zip'
path "/etc/chef/client.zip"
end

错误日志

Errno::ENOENT --------------没有这样的文件或目录@rb_sysopen -/server/repo/client.zip

Resource Declaration: --------------------- 
# In 52: remote_file 'download' do
53: source 'file:////server/repo/client.zip'
54: path "/etc/chef/client.zip"
56: end
57: #end

最佳答案

这在 UNC 路径上完全有效的事实有点意外(尽管以免有人误会它不会被删除 AFAIK)。 Linux 没有类似的模式。您可以使用 execute 资源和 cp 来涵盖基本用例。

execute 'cp /from /to' do
creates '/to'
end

关于linux - Linux 中的 remote_file 使用 Windows 共享,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33915633/

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