Class: Backup::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/backup/cli.rb

Defined Under Namespace

Modules: Helpers Classes: Error, FatalError

Instance Method Summary collapse

Instance Method Details

#checkObject

Check

Loads the user’s ‘config.rb` (and all Model files) and reports any Errors or Warnings. This is primarily for checking for syntax errors, missing dependencies and deprecation warnings.

This may also be invoked using the ‘–check` option to `backup perform`.

This command only requires ‘Config.config_file` to be correct. All other Config paths are irrelevant.

All output will be sent to the console only. Logger options will be ignored.

If successful, this method with exit(0). If there are Errors or Warnings, it will exit(1).



206
# File 'lib/backup/cli.rb', line 206

desc 'check', 'Check for configuration errors or warnings'

#performObject

Perform

The only required option is the –trigger [-t]. If –config-file, –data-path, –tmp-path or –log-path aren’t specified they will fallback to 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”.

This command will exit with one of the following status codes:

0: All triggers were successful and no warnings were issued.
1: All triggers were successful, but some had warnings.
2: All triggers were processed, but some failed.
3: A fatal error caused Backup to exit.
   Some triggers may not have been processed.

If the –check option is given, ‘backup check` will be run and no triggers will be performed.



30
# File 'lib/backup/cli.rb', line 30

desc 'perform', "Performs the backup for the specified trigger(s)."

#versionObject



345
346
347
# File 'lib/backup/cli.rb', line 345

def version
  puts "Backup #{ Backup::VERSION }"
end