Documentation ¶
Index ¶
Constants ¶
const BackupEnabled = "ch.floor4:backup_enabled"
BackupEnabled zfs attribute. True means filesystem should be backed up
const IncrementalInterval = "ch.floor4:incremental_interval"
IncrementalInterval zfs attribute. Specifies the time in seconds between two incremental backups
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backup ¶
type Backup interface { // It can't be started again after calling MarkSuccessful MarkSuccessful(archiveID string) error GetPartSize() int NextPart() (io.ReadSeeker, []byte) HasNextPart() bool GetBaseDataset() zfsiface.Dataset GetDataset() zfsiface.Dataset IsIncremental() bool GetDescription() string }
A Backup is a backup process that when started writes the backup to a backup location
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
A Batch contains zfs filesystems that can be stored in aws glacier when executed
func NewBatch ¶
NewBatch creates a new batch If filter is set, only filesystems under the given path are considered.
func (*Batch) Init ¶
Init prepares the Batch for execution with Run It searches for ZFS filesystems which are tagged for backup and whose next backup is due. Initialize aws client It also checks which vaults already exist on aws glacier
type Filesystem ¶
type Filesystem interface { // IsBackupEnabled returns true if the backup it should be backed up on a regular basis IsBackupEnabled() bool // GetVaultName transforms the filesystem name into a valid aws vault name // It replaces all non -a-zA-Z0-9 characters with underscores GetVaultName() string // IsDue returns true if it is time for a next backup IsDue() bool // Backup returns a Backup which can be started. It will then write the backup to the given writer. // Depending on the backup history it decides if a full or an incremental backup should be done. Backup(forceFull bool) Backup }
A Filesystem provides all information to decide if a backup should be done
func ListZFSFilesystems ¶
func ListZFSFilesystems(filter string) ([]Filesystem, error)
ListZFSFilesystems returns a list of all zfs filesystems under the path given by filter
type Metadata ¶
Metadata contains information for a backup that is rendered as JSON It is saved as description field in aws
type ZFSFilesystem ¶
type ZFSFilesystem struct {
// contains filtered or unexported fields
}
ZFSFilesystem extends the go-zfs ZFSFilesystem with properties needed for
func (*ZFSFilesystem) Backup ¶
func (fs *ZFSFilesystem) Backup(forceFull bool) Backup
Backup returns a Backup which can be started. It will then write the backup to the given writer. Depending on the backup history it decides if a full or an incremental backup should be done.
func (*ZFSFilesystem) GetVaultName ¶
func (fs *ZFSFilesystem) GetVaultName() string
GetVaultName transforms the filesystem name into a valid aws vault name It replaces all non -a-zA-Z0-9 characters with underscores
func (*ZFSFilesystem) IsBackupEnabled ¶
func (fs *ZFSFilesystem) IsBackupEnabled() bool
IsBackupEnabled returns true if the backup it should be backed up on a regular basis
func (*ZFSFilesystem) IsDue ¶
func (fs *ZFSFilesystem) IsDue() bool
IsDue returns true if it is time for a next backup