Hi forum,
I am trying to create a simple script to make incremental backups of my FreeBSD server into a FreeNAS box by using rsync(1) and some programme options.
The goal is to make a script that can run from cron(8) on a daily basis.
Before I can reach the goal, the basic functionality must be right.
For the moment, the script looks like this:
The output shows an error:
I know this has to do with variable expansion in the shell. I have searched the Internet to look for solutions. I can see this is a common problem, and that the solution might be to use arrays in the script. I just cannot figure out how to do that.
Any help is very much appreciated.
Regards,
Jon
I am trying to create a simple script to make incremental backups of my FreeBSD server into a FreeNAS box by using rsync(1) and some programme options.
The goal is to make a script that can run from cron(8) on a daily basis.
Before I can reach the goal, the basic functionality must be right.
For the moment, the script looks like this:
Code:
#!/bin/sh
SRC=" / "
DST="root@mfl-nas:/mnt/naspool/nasstorage/backup/server/rsync/"
LNKDST="--link-dest=../full"
FULL="/full"
EXCL="--exclude '/home' --exclude 'dev/' --exclude '/storage' --exclude '/mnt' "
SSHCONNECT="-e 'ssh -p 9851'"
DATE="daily-`date +%Y-%m-%d`"
OPT="-az --ignore-existing --stats "
LOG=" --remote-option=--log-file=/mnt/naspool/nasstorage/home/my-home-dir/rsync.log "
rsync ${OPT}${SSHCONNECT}${LOG}${EXCL}${LNKDST}${SRC}${DST}${DATE}
Code:
# ./root/bin/rsync_incremental.sh
Missing trailing-' in remote-shell command.
Any help is very much appreciated.
Regards,
Jon