github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/command/operator_snapshot.go (about)

     1  package command
     2  
     3  import (
     4  	"strings"
     5  
     6  	"github.com/mitchellh/cli"
     7  )
     8  
     9  type OperatorSnapshotCommand struct {
    10  	Meta
    11  }
    12  
    13  func (f *OperatorSnapshotCommand) Help() string {
    14  	helpText := `
    15  Usage: nomad operator snapshot <subcommand> [options]
    16  
    17    This command has subcommands for saving and inspecting the state
    18    of the Nomad servers for disaster recovery. These are atomic, point-in-time
    19    snapshots which include jobs, nodes, allocations, periodic jobs, and ACLs.
    20  
    21    If ACLs are enabled, a management token must be supplied in order to perform
    22    snapshot operations.
    23  
    24    Create a snapshot:
    25  
    26        $ nomad operator snapshot save backup.snap
    27  
    28    Inspect a snapshot:
    29  
    30        $ nomad operator snapshot inspect backup.snap
    31  
    32    Run a daemon process that locally saves a snapshot every hour (available only in
    33    Nomad Enterprise) :
    34  
    35        $ nomad operator snapshot agent
    36  
    37    Please see the individual subcommand help for detailed usage information.
    38  `
    39  	return strings.TrimSpace(helpText)
    40  }
    41  
    42  func (f *OperatorSnapshotCommand) Synopsis() string {
    43  	return "Saves and inspects snapshots of Nomad server state"
    44  }
    45  
    46  func (f *OperatorSnapshotCommand) Name() string { return "operator snapshot" }
    47  
    48  func (f *OperatorSnapshotCommand) Run(args []string) int {
    49  	return cli.RunResultHelp
    50  }