Sha256: 6dceac410dde4a60c7e8a81205f2348815d511a026f1ea646378ff89d1869a41

Contents?: true

Size: 720 Bytes

Versions: 1

Compression:

Stored size: 720 Bytes

Contents

#!/usr/bin/env ruby
require 'fileutils'
require 'optparse'
require 'date'

arg1, *FILES = ARGV
@base_path = Dir.pwd

repos = [Hash.new]

repos.push({folder_development: 'adminbodega'
		})	
repos.push({folder_development: 'operario'
		})
repos.push({folder_development: 'clientebodega'
		})
repos.push({folder_development: 'server'
		})

def backup (folder)
	folder_development = folder[:folder_development]
	Dir.chdir("#{@base_path}")
	date = Date.today.strftime('%d-%m-%Y')
	system("mkdir -p backup/#{date}")
	system("cp -TR #{folder_development} backup/#{date}/#{folder_development}")
end

def restore (folder)


end


case arg1

when "backup"
	FILES.each do |arg|
		backup(repos[arg.to_i])
	end
else
	puts "Nada"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
forcast-0.0.110 lib/lib/backup.rb