I am trying to write a simple backup script in Ruby that copies a folder to a specific directory with a timestamp in its name. My code (simplified):
require 'Fileutils.rb'
time = Time.now
FileUtils.cp_r "C:/somefolder", "D:/somefolder_backup_#{time}"
But I keep getting
`fu_mkdir': Unknown error - mkdir failed (SystemCallError)
The same thing happens if I just want to create a folder with the current time in it:
FileUtils.mkdir "C:/somefolder_#{time}"
This doesn't seem to be a privilege issue, unless I specify # {time} -thing, it works fine.
Any advice is appreciated.
source
share