Thor
Shorthand for decrypting encrypted files
# File lib/backup/cli/utility.rb, line 164 desc 'decrypt', 'Decrypts encrypted files'
Returns a list of Backup's dependencies
# File lib/backup/cli/utility.rb, line 189 desc 'dependencies', 'Display the list of dependencies for Backup, check the installation status, or install them through Backup.'
Generates the main configuration file
# File lib/backup/cli/utility.rb, line 144 desc 'generate:config', 'Generates the main Backup bootstrap/configuration file'
Generates a model configuration file based on the arguments passed in. For example:
$ backup generate:model --trigger my_backup --databases='mongodb'
will generate a pre-populated model with a base MongoDB setup
# File lib/backup/cli/utility.rb, line 91 desc 'generate:model', "Generates a Backup model file\n\n" +
# File lib/backup/cli/utility.rb, line 30 def perform ## # Silence Backup::Logger from printing to STDOUT, if --quiet was specified Logger.quiet = options[:quiet] ## # Update Config variables based on the given options Config.update(options) ## # Ensure the :log_path, :cache_path and :tmp_path are created # if they do not yet exist [Config.log_path, Config.cache_path, Config.tmp_path].each do |path| FileUtils.mkdir_p(path) end ## # Load the configuration file Config.load_config! ## # Truncate log file if needed Logger.truncate! ## # Prepare all trigger names by splitting them by ',' # and finding trigger names matching wildcard triggers = options[:trigger].split(",") triggers.map!(&:strip).map! {|t| t.include?('*') ? Model.find_matching(t).map(&:trigger) : t }.flatten! ## # Process each trigger triggers.each do |trigger| ## # Find the model for this trigger # Will raise an error if not found model = Model.find(trigger) ## # Prepare and Perform the backup model.prepare! model.perform! ## # Clear the Log Messages for the next potential run Logger.clear! end rescue => err Logger.error Errors::CLIError.wrap(err) exit(1) end
Performs the backup process. The only required option is the --trigger [-t]. If the other options (--config-file, --data-path, --cache--path, --tmp-path) aren't specified they will fallback to the (good) defaults
If --root-path is given, it will be used as the base path for our defaults, as well as the base path for any option specified as a relative path. Any option given as an absolute path will be used "as-is".
# File lib/backup/cli/utility.rb, line 18 method_option :trigger, :type => :string, :required => true, :aliases => ['-t', '--triggers']
Generated with the Darkfish Rdoc Generator 2.