-
Notifications
You must be signed in to change notification settings - Fork 0
The Command Line Utility
Below is a list of the available commands for the backup
command line utility.
Bring up the available commands with:
$ backup help
Bring up details for a specific command using:
$ backup help <command name>
The check
command is used to check your Backup configuration. This command will load your
config.rb
file, along with all of your model files, and report any Errors or Warnings
generated. This allows to you check your configuration files for syntax errors, as well as
detecting other errors or warning such as the use of deprecated configuration settings.
It is recommended that you run backup check
whenever you update backup
.
If your config.rb
file is not in the default location of ~/Backup/config.rb
, use the
--config-file
argument to specify it's location.
$ backup check --config-file /path/to/config.rb
As a convenience, this check may also be performed by adding the --check
option to your
backup perform
command, in which case the trigger
specified will not be performed.
$ backup perform --trigger my_backup --check
The result of this check will be output to the console only. Any Logger configuration
will be ignored. If the check is successful, this command will exit with status code 0
. If there
are any errors/warnings, it will exit with status code 1
.
Note that there are certain actions performed during the backup process may generate errors and/or
warnings this check can not detect. While this will catch most problems, you should of course
use perform
to confirm your backup jobs will succeed.
The perform
action is used to run the backup job(s) you have defined in your model files.
To perform a backup model, use:
$ backup perform --trigger my_backup
The trigger
identifies the model and is set when it is defined.
# The trigger here is: my_backup
Backup::Model.new(:my_backup, 'Description for my_backup') do
# etc...
end
To asynchronously perform multiple backup models, provide multiple triggers, each separated by a comma.
$ backup perform --triggers my_backup_1,my_backup_2,my_backup_3
Each trigger will be run in the order specified, one after the other.
See Performing Backups for more information.
The generate
command can be used to generate the main Backup configuration file and new Backup model files.
To generate a new Backup config file (~/Backup/config.rb
), use:
$ backup generate:config
To generate a new Backup model file (~/Backup/models/new_trigger.rb
), use:
$ backup generate:model --trigger new_trigger [options...]
These files are generated from templates that contain basic configuration information and comments, based on the options you provide, to help you easily setup new backup jobs.
See the Generator page for more information.
Displays the current version of Backup:
$ backup version