
#!/bin/sh
# File	: restore_dir.sh
# By	: MaartenDeBoer.nl, 180727
# Subject	: Backup (tar) a directory & SSH-copy it to remote/destination host
PGM="`basename $0|cut -d\. -f1`"
VER="0.1"
TMP="/tmp/${PGM}.$$"
LOG="${HOME}/log/${PGM}.log"

DIR="/var/www/vhosts/scripts.agrarix.com/html/"
TARFILE="scripts-dir.tgz"

echo "`date` ${PGM} v${VER} started."|tee -a ${LOG}
touch ${TMP}

ls -l ${HOME}/${TARFILE} | tee -a ${LOG}
sleep 1
cd ${DIR}
tar xvzf ${HOME}/${TARFILE} .

echo "`date` ${PGM} finished."|tee -a ${LOG}
rm ${TMP}
exit 0

