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
61
|
# File 'lib/backup/environment/unix.rb', line 21
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 <<-MESSAGE
==============================================================
Backup has been set up!
==============================================================
1: Set up some "Backup Settings" inside the configuration file!
/opt/backup/config/backup.rb
2: Run the backups!
sudo backup --run [trigger]
For a list of Backup commands:
sudo backup --help
For More Information:
http://github.com/meskyanichi/backup
==============================================================
MESSAGE
else
puts "\nBackup is already installed in #{BACKUP_PATH}..\n"
puts "If you want to reset it, run:\n\nbackup --reset\n\n"
puts "This will reinstall it."
puts "Warning: All configuration will be lost!\n\n"
end
end
|