|
|
@@ -114,8 +114,10 @@ func moveLogFile(logfile string, target string, uuid string) {
|
|
|
//If then else is used to prevent invalid move target
|
|
|
if target == "done" {
|
|
|
os.Rename(logfile, "log/done/"+uuid+".log")
|
|
|
+ os.Chmod("log/done/"+uuid+".log", 0777) //Unlock the file for read write from php
|
|
|
} else if target == "error" {
|
|
|
os.Rename(logfile, "log/error/"+uuid+".log")
|
|
|
+ os.Chmod("log/error/"+uuid+".log", 0777) //Unlock the file for read write from php
|
|
|
} else {
|
|
|
//What happened?o
|
|
|
panic("ERROR. Undefined log file sattle location.")
|
|
|
@@ -129,9 +131,6 @@ func finishFileOperation(logfile string, uuid string) {
|
|
|
writeLog(logfile, "[done] ", "Task finished successfully")
|
|
|
moveLogFile(logfile, "done", uuid)
|
|
|
fmt.Println("Done")
|
|
|
- os.Chmod("log/", 0777) //Try to give log folder permissions to PHP for removal.
|
|
|
- os.Chmod("log/done/", 0777)
|
|
|
- os.Chmod("log/error/", 0777)
|
|
|
}
|
|
|
|
|
|
func initChk() {
|