Added system.CopyDir and EdgeappsBackupPath conf

This commit is contained in:
=
2023-06-10 17:29:54 +02:00
parent e009c1f55d
commit 8bf26a334c
4 changed files with 103 additions and 12 deletions
+2 -2
View File
@@ -626,7 +626,7 @@ func taskRestoreBackup() string {
// Copy all files in /home/system/components/apps/ to a backup folder
fmt.Println("Copying all files in /home/system/components/apps/ to a backup folder")
os.MkdirAll(utils.GetPath(utils.EdgeAppsBackupPath + "temp/"), 0777)
utils.CopyDir(utils.GetPath(utils.EdgeAppsPath), utils.GetPath(utils.EdgeAppsBackupPath + "temp/"))
system.CopyDir(utils.GetPath(utils.EdgeAppsPath), utils.GetPath(utils.EdgeAppsBackupPath + "temp/"))
fmt.Println("Removing all files in /home/system/components/apps/")
os.RemoveAll(utils.GetPath(utils.EdgeAppsPath))
@@ -649,7 +649,7 @@ func taskRestoreBackup() string {
if strings.Contains(result, "Fatal:") {
// Copy all files from backup folder to /home/system/components/apps/
os.MkdirAll(utils.GetPath(utils.EdgeAppsPath), 0777)
utils.CopyDir(utils.GetPath(utils.EdgeAppsBackupPath + "temp/"), utils.GetPath(utils.EdgeAppsPath))
system.CopyDir(utils.GetPath(utils.EdgeAppsBackupPath + "temp/"), utils.GetPath(utils.EdgeAppsPath))
fmt.Println("Error restoring backup: ")
utils.WriteOption("BACKUP_STATUS", "error")