#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail

MIRROR_DIR="/data/backup/mirror/$(date +%Y%m)"
MIRROR_CHECK_DIR="/data/backup/mirror/$(date -d "-6 month" +%Y%m)"

if [ ! -d "${MIRROR_DIR}" ]
then
	mkdir -p "${MIRROR_DIR}"
fi
if [ -d "${MIRROR_CHECK_DIR}" ] 
then
	rm -rf "${MIRROR_CHECK_DIR}"
fi
cp -R /data/backup/compress/* /data/backup/mirror/$(date +%Y%m) 
lftp -c "open -u admin,\!@#gds\$%^ 118.45.160.139 -p 2121; mirror -R /data/backup/mirror /homes/java/203"
