Sandeep540
Sandeep540

Reputation: 977

Move (cut-paste) a File in Windows Server using Chef

I want to move a file from one location to another in Windows Server using Chef. I am passing the Target Directory as Variable, its not working... any pointers

directory_name = e:\\temp
execute 'copy_MSlog' do
  command move "E:\\Test\\Untitled.png #{directory_name}"
end

Upvotes: 0

Views: 34

Answers (1)

coderanger
coderanger

Reputation: 54221

Unfortunately file moves with Chef are a bit dicey since they are difficult to make idempotent and convergent. You need to fix your quoting but otherwise you're on the right track. Use some not_if or only_if guards to ensure idempotence and you should be all set.

Upvotes: 1

Related Questions