Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question

1 Answer 1

up vote 1 down vote accepted

$LPATH is not defined. Your script has no destination to copy the files to. You are missing an L where it says PATH=/backup/path/mailserver-folder.

share|improve this answer
    
Holy Cow! Thanks for pointing that out. Sometimes you look at something for so long something stupid like that slips past you. I made the fix and it is working fine. Thanks! –  user3645482 May 16 at 17:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.