Skip to content

Commit

Permalink
rsync fix
Browse files Browse the repository at this point in the history
  • Loading branch information
slspeek committed May 1, 2024
1 parent 5d90171 commit 4c8283f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/rsync-home.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
set -e

BACKUP_NAME=$1
BACKUP_HOST=$2
BACKUP_DIR=$3
BACKUP_USER=$2
BACKUP_HOST=$3
BACKUP_DIR=$4

TIMESTAMP=$(date +%Y%m%d-%H%M)
DEFAULT_TARGETDIR=/home/${BACKUP_NAME}-backup-${TIMESTAMP}/
TARGETDIR=${3:-$DEFAULT_TARGETDIR}
DEFAULT_TARGETDIR=/home/${BACKUP_USER}/${BACKUP_NAME}-backup-${TIMESTAMP}/
TARGETDIR=${4:-$DEFAULT_TARGETDIR}

ssh $BACKUP_HOST mkdir -p $TARGETDIR
RSYNC_CMD="rsync -ar --delete -v"
Expand Down

0 comments on commit 4c8283f

Please sign in to comment.