cmd

package
v0.0.0-...-f2f83b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ClearAllTablesCmd = &cobra.Command{
		Use:   "clear-tables",
		Short: "Deletes all records from tables.",
		RunE: func(cmd *cobra.Command, args []string) error {

			db.ClearAllTables()

			return nil
		},
	}
)

Functions

func AddDrive

func AddDrive(drive_letter string, drive_name string) string

func AddSource

func AddSource(source_paths []string, archive_name string)

func BackupDatabase

func BackupDatabase() int

func BackupFileDir

func BackupFileDir(source_ids []int64, archive_names []string) int

func CreateDiskIdentityFile

func CreateDiskIdentityFile(drive_letter string, ksuid string) bool

Creates .drive file with ksuid in it

func CreateSourceBackup

func CreateSourceBackup(source_paths []string, backup_paths []string, archive_name string) error

Creates records for source-backup relation Archive name is optional

func Execute

func Execute()

Execute executes the root command.

func GetDrivesWithDB

func GetDrivesWithDB() []string

func Ksuid2Drive

func Ksuid2Drive(ksuid string) string

Get path to drive by ksuid

func ListArchives

func ListArchives()

func ListBackups

func ListBackups() int

func ListDrives

func ListDrives()

Lists drives and their statuses

func LoadDBFromDrive

func LoadDBFromDrive(drive_letter string) error

func NewDriveRecord

func NewDriveRecord(drive_letter string) database.DriveRecord

func RemoveDestination

func RemoveDestination(archive_id int64, drive_ksuid string) int

func RemoveDestinationByArchive

func RemoveDestinationByArchive(archive_name string) int

func RemoveDestinationByDrive

func RemoveDestinationByDrive(drive_letter string) int

func RemoveDestinationByPath

func RemoveDestinationByPath(destination_path string)

func RemoveSource

func RemoveSource(source_id int64) error

func RemoveUnusedArchive

func RemoveUnusedArchive(archive_id int64) bool

func RestoreFileDir

func RestoreFileDir(source_ids []int64, archive_names []string, backup_paths []string) int

func SpreadDatabase

func SpreadDatabase(drive_letter string) int

func TestRootCmd

func TestRootCmd() *cobra.Command

func TransformBackups

func TransformBackups(backup_rels map[int64]database.BackupRel) map[string]database.BackupPaths

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL