record commandline arguments to backup log

This commit is contained in:
r0n1n7an 2023-11-20 15:38:04 +08:00
parent ae925f2bad
commit 133dc0513d
2 changed files with 4 additions and 1 deletions

Binary file not shown.

View File

@ -3,6 +3,7 @@ package main
import ( import (
"bufio" "bufio"
"flag" "flag"
"fmt"
"log" "log"
"os" "os"
"path/filepath" "path/filepath"
@ -62,6 +63,8 @@ func init() {
func main() { func main() {
log.SetOutput(os.Stdout) log.SetOutput(os.Stdout)
log.Printf("[MSG] Commandline: %v\r\n", os.Args) log.Printf("[MSG] Commandline: %v\r\n", os.Args)
bkupList = append(bkupList, fmt.Sprintf("### Commandline: %v", os.Args))
_, err := os.Stat(aodPath) _, err := os.Stat(aodPath)
if err != nil { if err != nil {
log.Printf("[ERR] Path Of AODs Not Exists.\r\n") log.Printf("[ERR] Path Of AODs Not Exists.\r\n")
@ -236,7 +239,7 @@ func main() {
} }
} }
} }
_WriteFileFromStringSlice("./Backup_"+time.Now().Format("2006-01-02_15:04:05")+".txt", bkupList) _WriteFileFromStringSlice("./Backup_"+time.Now().Format("2006-01-02_15-04-05")+".txt", bkupList)
log.Printf("[MSG] Total Backed Up Modules: %d\r\n", ttl) log.Printf("[MSG] Total Backed Up Modules: %d\r\n", ttl)
} }
} }