20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/backup/environment/unix_configuration.rb', line 20
def setup
unless File.directory?(BACKUP_PATH)
puts "Installing Backup in #{BACKUP_PATH}.."
%x{ #{sudo} mkdir -p #{File.join(BACKUP_PATH, 'config')} }
%x{ #{sudo} cp #{File.join(File.dirname(__FILE__), '..', '..', '..', 'setup', 'backup.sqlite3')} #{BACKUP_PATH} }
%x{ #{sudo} cp #{File.join(File.dirname(__FILE__), '..', '..', '..', 'setup', 'backup.rb')} #{File.join(BACKUP_PATH, 'config')} }
puts " \n ==============================================================\n Backup has been set up!\n ==============================================================\n\n 1: Set up some \"Backup Settings\" inside the configuration file!\n\n \#{BACKUP_PATH}/config/backup.rb\n\n\n 2: Run the backups!\n\n sudo backup --run [trigger]\n\n\n For a list of Backup commands:\n\n sudo backup --help\n \n\n For More Information:\n\n http://github.com/meskyanichi/backup\n\n ==============================================================\n \n MESSAGE\n else\n puts \"\\nBackup is already installed in \#{BACKUP_PATH}..\\n\"\n puts \"If you want to reset it, run:\\n\\nbackup --reset\\n\\n\"\n puts \"This will reinstall it.\"\n puts \"Warning: All configuration will be lost!\\n\\n\"\n end\nend\n"
|