Skip to content

Commit

Permalink
Wordmark replacements: chef-server-ctl/plugins/backup (chef#1949)
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Gitlin <jgitlin@pinnacle21.com>
  • Loading branch information
jgitlin-p21 committed Oct 18, 2021
1 parent 3087814 commit 6dbb606
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/chef-server-ctl/plugins/backup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "optparse"
require "ostruct"

add_command_under_category "backup", "general", "Backup the Chef Infra Server", 2 do
add_command_under_category "backup", "general", "Backup the #{ChefUtils::Dist::Server::PRODUCT}", 2 do
ensure_configured!
ensure_rsync!

Expand All @@ -12,7 +12,7 @@
options.config_only = false

OptionParser.new do |opts|
opts.banner = "Usage: chef-server-ctl backup [options]"
opts.banner = "Usage: #{ChefUtils::Dist::Server::SERVER_CTL} backup [options]"

opts.on("-y", "--yes", "Agree to go offline during tar based backups") do
options.agree_to_go_offline = true
Expand Down Expand Up @@ -48,21 +48,21 @@
exit(0)
end

add_command_under_category "restore", "general", "Restore the Chef Infra Server from backup", 2 do
add_command_under_category "restore", "general", "Restore the #{ChefUtils::Dist::Server::PRODUCT} from backup", 2 do
ensure_rsync!

options = OpenStruct.new
options.agree_to_cleanse = nil
options.restore_dir = nil

OptionParser.new do |opts|
opts.banner = "Usage: chef-server-ctl restore $PATH_TO_BACKUP_TARBALL [options]"
opts.banner = "Usage: #{ChefUtils::Dist::Server::SERVER_CTL} restore $PATH_TO_BACKUP_TARBALL [options]"

opts.on("-d", "--staging-dir [directory]", String, "The path to an empty directory for use in restoration. Ensure it has enough available space for all expanded data in the backup archive") do |staging_directory|
options.restore_dir = File.expand_path(staging_directory)
end

opts.on("-c", "--cleanse", "Agree to cleansing all existing state during a restore. THIS WILL COMPLETELY REMOVING EXISTING CHEF DATA") do
opts.on("-c", "--cleanse", "Agree to cleansing all existing state during a restore. THIS WILL COMPLETELY REMOVING EXISTING #{ChefUtils::Dist::Server::PRODUCT.upcase} DATA") do
options.agree_to_cleanse = "yes"
end

Expand All @@ -82,7 +82,7 @@

unless ARGV.length >= 2
log("Invalid command", :error)
log("USAGE: chef-server-ctl restore $PATH_TO_BACKUP_TARBALL [options]", :error)
log("USAGE: #{ChefUtils::Dist::Server::SERVER_CTL} restore $PATH_TO_BACKUP_TARBALL [options]", :error)
exit(1)
end

Expand All @@ -109,7 +109,7 @@ def ensure_rsync!

def ensure_configured!
unless running_config
log("You must reconfigure the Chef Server before a backup can be performed", :error)
log("You must reconfigure the #{ChefUtils::Dist::Server::PRODUCT} before a backup can be performed", :error)
exit(1)
end
end
Expand Down

0 comments on commit 6dbb606

Please sign in to comment.