class Backup::CLI
Public Instance Methods
- Version
-
Returns the current version of the
Backup
gem
# File lib/backup/cli.rb, line 343 map '-v' => :version
- 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).
# File lib/backup/cli.rb, line 206 desc 'check', 'Check for configuration errors or warnings'
- Generate:Config
-
Generates the main configuration file
# File lib/backup/cli.rb, line 313 desc 'generate:config', 'Generates the main Backup configuration file'
- Generate:Model
-
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.rb, line 248 desc 'generate:model', "Generates a Backup model file."
- 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.
# File lib/backup/cli.rb, line 30 desc 'perform', "Performs the backup for the specified trigger(s)."
# File lib/backup/cli.rb, line 345 def version puts "Backup #{ Backup::VERSION }" end