swap out wget for lftp

This commit is contained in:
Anthony Mineo 2021-03-16 20:10:59 -04:00
parent fbff090ba5
commit 0bbfa32ef6
3 changed files with 8 additions and 3 deletions

View file

@ -31,7 +31,12 @@ func initFTP() {
fmt.Println("Downloading stat files from", ftpHOST + ftpPath)
cmd := "wget --recursive --no-passive-ftp -nH --cut-dirs=4 --ftp-user=" + ftpUSER + " --no-parent --ftp-password="+ ftpPW +" -P /app/serverStats/stats/ ftp://" + ftpHOST + ftpPath
// wget is a bit buggy with FTP in v1.20.x
// cmd := "wget --recursive --no-passive-ftp -nH --cut-dirs=4 --ftp-user=" + ftpUSER + " --no-parent --ftp-password="+ ftpPW +" -P /app/serverStats/stats/ ftp://" + ftpHOST + ftpPath
cmd := "lftp -c 'open "+ftpHOST+"; user "+ftpUSER+" "+ftpPW+"; mirror -e "+ftpPath+" /app/serverStats/stats/; quit'"
err, out, errout := Shellout(cmd)

View file

@ -24,7 +24,7 @@ RUN go build -o main .
FROM golang:1.14-alpine
LABEL maintainer="Anthony Mineo <anthonymineo@gmail.com>"
RUN apk update && apk add --no-cache wget tzdata
RUN apk update && apk add --no-cache wget tzdata lftp
#Set TimeZone
ENV TZ=America/New_York

View file

@ -24,7 +24,7 @@ services:
constraints: [node.role == manager]
parser:
image: "amineo/t2-stats-parser:v0.4.1"
image: "amineo/t2-stats-parser:v0.5.0"
build:
context: .
dockerfile: ./build/go-t2-stat-parser/Dockerfile