I am trying to copy backup files of my companies mail server to our backup server via RSYNC. I use this same script for backing up our web hosting server backup files with no issues. When I type this out by hand from the command line it works perfectly, but when I run it from a bash script all I receive is the incremental file list and no files are copied. Here is script I am running. Please help!
#!/bin/bash RSYNC=/usr/bin/rsync SSH=/usr/bin/ssh KEY=/root/cron/backup-rsync-key RUSER=user RHOST=mail.server.net RPATH=/backup/path/ PATH=/backup/path/mailserver-folder $RSYNC -ae "$SSH -i $KEY" --progress --log-file=rsync.log $RUSER@$RHOST:$RPATH $LPATH