change date to backup total folder on remote filesystem
This commit is contained in:
parent
7cc818be59
commit
0953ca28c9
|
@ -11,13 +11,13 @@ ORIGIN_DATA_PATH=$2
|
|||
REMOTE_SERVER=$3
|
||||
REMOTE_PATH=$4
|
||||
LATEST_LINK="latest"
|
||||
CURRENT_DATE=`date +\%y\%m\%d\%H\%M.\%S`
|
||||
|
||||
touch $EXCLUDE_FILE
|
||||
cat > $EXCLUDE_FILE <<EOF
|
||||
files_trashbin
|
||||
nextcloud.log
|
||||
updater.log
|
||||
|
||||
EOF
|
||||
|
||||
echo "\n[NEW BACKUP TASK] Backup cloud all files (total)\n" >> $LOG_FILE
|
||||
|
@ -25,6 +25,9 @@ echo "\n[NEW BACKUP TASK] Backup cloud all files (total)\n" >> $LOG_FILE
|
|||
# rsync of new files last day into nextcloud every day (incremental)
|
||||
rsync -AaxzvPh $ORIGIN_DATA_PATH --exclude-from=$EXCLUDE_FILE "$REMOTE_SERVER:$REMOTE_PATH$BACKUP_DIR" >> $LOG_FILE
|
||||
|
||||
# set current date to sync remote folder
|
||||
ssh $REMOTE_SERVER "touch -t $CURRENT_DATE $REMOTE_PATH$BACKUP_DIR 2>&1" >> $LOG_FILE
|
||||
|
||||
# replace latest
|
||||
ssh $REMOTE_SERVER "rm -rf $REMOTE_PATH$LATEST_LINK && ln -s $REMOTE_PATH$BACKUP_DIR $REMOTE_PATH$LATEST_LINK 2>&1" >> $LOG_FILE
|
||||
|
||||
|
|
Loading…
Reference in New Issue