Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // RootDataset is the name of the ZFS dataset under which zackup // creates per-host datasets. RootDataset = "zroot" // MountBase is the name of the directory which zackup uses to // mount per-host datasets for rsync. // // A special directory (MountBase/.zackup) is used as working // directory for temporary files, such as SSH ControlPath sockets. MountBase = "/zpool/zackup" // RSyncPath might need to be adjusted if it's not in $PATH. RSyncPath = "rsync" // SSHPath might need to be adjusted if it's not in $PATH. SSHPath = "ssh" )
View Source
var ErrAlreadyConnected = errors.New("ssh: tunnel already established")
Functions ¶
func InitializeState ¶
InitializeState reads the performance metrics stored in the data.
func PerformBackup ¶
PerformBackup executes the backup job.
Types ¶
type HTTP ¶
type HTTP interface { // Start will start the HTTP server. Start() // Stop will graceful shut down the HTTP server. Stop() }
HTTP allows interaction with the zackup webserver.
type HostMetrics ¶
type HostMetrics struct { Host string // contains filtered or unexported fields }
HostMetrics represents a snapshot of the current metrics for a host.
func ExportState ¶
func ExportState() []HostMetrics
ExportState dumps the current performance metrics.
func (*HostMetrics) SpaceUsedTotal ¶
func (m *HostMetrics) SpaceUsedTotal() uint64
func (*HostMetrics) Status ¶
func (m *HostMetrics) Status() MetricStatus
type MetricStatus ¶
type MetricStatus int
MetricStatus represents the status of a metric set.
const ( StatusUnknown MetricStatus = iota StatusPrimed StatusSuccess StatusFailed StatusRunning )
All possible MetricStatus values.
func (MetricStatus) String ¶
func (s MetricStatus) String() string
type Queue ¶
type Queue interface { // Enqueue adds a job to the queue. The job is run immediately if the // queue is empty. This method may block if a backlog has accumulated. Enqueue(job *config.JobConfig) // Resize changes the size of the queue. When sizing down, surplus // running jobs will finish. Values for newSize are capped; for values // less then 1, 1 is assumed, and for values larger than an arbitrary // threshold, that threshold value is assumed. Resize(newSize int) // Wait will wait for all jobs to complete. Wait() }
Queue manages the parallel execution of jobs.
type Scheduler ¶
type Scheduler interface { // Start begins a new schedule cycle. This method will block until // you call Stop(). Start() // Stop halts the scheduler. Running jobs are still finished, though. Stop() }
The Scheduler periodically performs backups.
func NewScheduler ¶
NewScheduler returns a new scheduler instance. It reads the schedule interval from the config.Tree and enqueue new backup jobs into queue. The instance is not started yet, you need to call Start().
Click to show internal directories.
Click to hide internal directories.