我正在尝试使用以下脚本进行远程备份:
find /path/*.gz -exec rm {} \; && tar -czpvf $BACKUP_DIR/bdsomething-$DATE.tar.gz --exclude='this-file' /source/path && rsync -avhz --progress --delete /path-dir-backup root@10.x.x.x:/path-remote-server
但出现了以下错误:
rsync error: syntax or usage error (code 1) at main.c(1637) [Receiver=3.1.0]
./script_bkp.sh: line 9: --delete: command not found
我有另一个类似的脚本,只是没有使用 –exclude 选项,那个脚本运行正常,并且已添加到 crontab 中。
请问是语法错误还是用法错误?我不太明白问题出在哪里。
有人能帮忙吗?
谢谢,
Douglas