When I execute the following recipe, I get an error message. My requirement: I need to "move" only certain folders (log, tmp) from the source to another place, only if the folders are available in the source, if there is no need to move and successfully execute my resource. whenever I start the first resource with the source folders (log, tmp), it will succeed, but when the second resource is started the second time, it gives an error message because there are no folders (log, tmp) in the source. I need to successfully execute even folders (log tmp) that are not in the source. can you share yours, although by this requirement?
Below is my resource:
execute "move files" do command "mv #{node["source"]}/log tmp #{node["dest"]}" cwd node["direct"] only_if do File.exist?(node['source']) end end
Error message:
mv: cannot stat âlogâ: no such file or directory
mv: can't stat âtmpâ: No such file or directory
chef
Raja Aug 23 '16 at 16:04 2016-08-23 16:04
source share