#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail
# set -o xtrace



lastmonth=$(date -d "1 month ago" +%Y%m)
rootpath="/data/drainer/drainer.data"
archivedfile=$'drainer.pb.'$lastmonth.tgz

printf "\n"


ftp -i -n -v <<-EOF
open 10.10.0.93
user "wxc" "wxc"
cd drainer.pb
lcd ${rootpath}
bin
put $archivedfile
dir $archivedfile
bye
EOF