summaryrefslogtreecommitdiff
path: root/backup_personal_new
diff options
context:
space:
mode:
Diffstat (limited to 'backup_personal_new')
-rwxr-xr-xbackup_personal_new68
1 files changed, 0 insertions, 68 deletions
diff --git a/backup_personal_new b/backup_personal_new
deleted file mode 100755
index 0453b5e..0000000
--- a/backup_personal_new
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-#backup_personal_new
-#this script backs up personal documents to personal server or any specified source
-
-
-echo -e "backing up files $(date) \n" >> ~/.backuplog
-
-#required args:
-# [src] - folder/file to backup
-#optional args:
-# [dest hostname] - (hb) hostname/ip of server to backup to
-# [x - exlude files matching pattern
-# [xf] - exlude files matching patterns from file
-# []
-
-
-excluded=''
-src=''
-force=0
-excluded_list=""
-rsync_args=""
-ip='grothe.ddns.net'
-
-while getopts ":x:p:f:l:d:" opt; do
- case $opt in
- x)
- echo "excluding files/dirs $OPTARG"
- excluded="$OPTARG"
- rsync_args=$rsync_args"--exclude $OPTARG "
- ;;
- l)
- echo "exluding files/dirs from list from file $OPTARG"
- excluded_list="\"$OPTARG\""
- rsync_args=$rsync_args"--exclude-from $OPTARG "
- ;;
- p)
- echo "backing up path $OPTARG"
- src="$OPTARG"
- ;;
- f)
- echo "forcing backup of entire home dir.\n"
- force=1
- ;;
- d)
- echo "destination address = $OPTARG"
- ip="$OPTARG"
- ;;
- esac
-done
-
-echo $rsync_args
-
-if [ -z "$src" ]
-then
- if [[ $force == 1 ]]
- then
- echo "-f set, so will backup entire home dir.\n"
- rsync -avzpR -e ssh /home/thomas/ thomas@"$ip":backup | tee -a ~/.backuplog
- else
- echo "no custom path given. will do nothing.\n"
- exit 0
- fi
-else
- #rsync -avzp -e ssh --exclude-from "$excluded_list" --exclude $excluded /home/thomas/$src/ thomas@grothe.ddns.net:backup/$src | tee -a ~/.backuplog
- rsync -avzpP --relative -e ssh $rsync_args /home/thomas/./$src/ thomas@"$ip":backup/ | tee -a ~/.backuplog
-fi
-
-