1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package hybridBackup
- import (
- "log"
- )
- /*
- Hybrid Backup
- This module handle backup functions from the drive with Hieracchy labeled as "backup"
- Backup modes suport in this module currently consists of
- Denote P drive as parent drive and B drive as backup drive.
- 1. Smart (smart):
- - Any new file created in P will be copied to B within 5 minutes
- - Any file removed in P will be delete from backup after 24 hours
- 2. Nightly (nightly):
- - The whole P drive will be copied to N drive every night
- 3. Append Only (append)
- - Any new file created in P will be copied to B within 5 minutes
- - No file will be removed from B unless drive is fulled (Similar to CCTV recorder)
- */
- type BackupConfig struct {
- CycleCounter int64 //The number of backup executed in the background
- DiskUID string //The UID of the target fsandlr
- DiskPath string //The mount point for the disk
- ParentUID string //Parent virtal disk UUID
- ParentPath string //Parent disk path
- Mode string //Backup mode
- }
- func HandleBackupProcess(backupConfig *BackupConfig) (string, error) {
- log.Println(">>>>>> Running backup process: ", backupConfig)
- if backupConfig.Mode == "smart" {
- } else if backupConfig.Mode == "nightly" {
- } else if backupConfig.Mode == "append" {
- }
- //Add one to the cycle counter
- backupConfig.CycleCounter++
- //Return the log information
- return "", nil
- }
|