From 8b180b7fe1e3216137e1ae57009788f189f9058d Mon Sep 17 00:00:00 2001 From: wbudic Date: Sun, 29 Aug 2021 10:02:49 +1000 Subject: [PATCH] Automated server backup to local machine. --- backupDBLifeLog.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/backupDBLifeLog.sh b/backupDBLifeLog.sh index 335ae3d..71187e9 100755 --- a/backupDBLifeLog.sh +++ b/backupDBLifeLog.sh @@ -8,9 +8,13 @@ # Programed by: Will Budic # Open Source License -> https://choosealicense.com/licenses/isc/ #Example crontab -e entry for every three hours. -#crontab -> * */3 * * * ./backupDBLifeLog.sh > /dev/null 2>&1 +#crontab -> * */3 * * * /home/will/dev/backupDBLifeLog.sh > /dev/null 2>&1 -DIR="/home/will/Documents/dbLifeLog" +export DISPLAY=":0" +export XDG_RUNTIME_DIR=/run/user/$(id -u) +export XAUTHORITY="/home/will/.Xauthority" +export SSHPASS='N0-MA-E9-5E-4A-C6-MJ-2F' +DIR="/home/will/backups/r2d2_dbLifeLog" NOW=`date +%Y%m%d` if [ ! -d "$DIR" ]; then @@ -18,7 +22,7 @@ if [ ! -d "$DIR" ]; then fi cd $DIR -sftp will@nuc:/home/will/thttpd_dev/dbLifeLog/ <