Jelajahi Sumber

Added restore endpoint

TC pushbot 5 4 tahun lalu
induk
melakukan
630c12cdac
1 mengubah file dengan 7 tambahan dan 2 penghapusan
  1. 7 2
      mod/filesystem/hybridBackup/hybridBackup.go

+ 7 - 2
mod/filesystem/hybridBackup/hybridBackup.go

@@ -122,7 +122,6 @@ func executeBackup(backupConfig *BackupConfig, deepBackup bool) (string, error)
 						copiedFileList = append(copiedFileList, assumedTargetPosition)
 					}
 				}
-
 			}
 		}
 
@@ -153,7 +152,7 @@ func executeBackup(backupConfig *BackupConfig, deepBackup bool) (string, error)
 					log.Println("[Debug] Adding " + filename + " to delete marker")
 				} else {
 					//This file has been marked. Check if it is time to delete
-					if time.Now().Unix()-val > 120 {
+					if time.Now().Unix()-val > 3600*24 {
 						log.Println("[Debug] Deleting " + filename)
 
 						//Remove the backup file
@@ -223,6 +222,12 @@ func HandleBackupProcess(backupConfig *BackupConfig) (string, error) {
 	return "", nil
 }
 
+//Restore accidentailly removed file from backup
+func HandleRestore(backupConfig *BackupConfig, targetFile string) error {
+
+	return nil
+}
+
 //Get and return the file hash for a file
 func getFileHash(filename string) (string, error) {
 	f, err := os.Open(filename)