[ale] rsync + ssh + cron

Björn Gustafsson bg-ale at bjorng.net
Tue May 23 15:20:32 EDT 2006


In that case your script will probably work if you change the final line to:

eval $COMMAND

... the problem being that the shell doesn't get to interpret the
quotes in the command, given the way that you provide them.  The shell
variable gets expanded by the shell, but the contents of the variable
don't get expanded by the shell.  Using eval allows that second level
of interpretation to take place.

On 5/23/06, Nathan J. Underwood <ale1 at cybertechcafe.net> wrote:
>
>  Thanks for the quick response.  The command line that the script is
> generating (
>  /usr/bin/rsync -av -e 'ssh -p 2201' /home/nathan/source/
> nathan at lint-1:/home/nathan/destination --progress --stats --compress
> --delete ) is actually working if I just copy and paste it to a [new]
> command line.  The problem though is that it won't run from the script.
>
>  Jim Popovitch wrote:
>  Nathan J. Underwood wrote:
>
>  The error that I'm getting (figured that may be handy) when I try to run
> it is:
>
> /usr/bin/rsync -av -e 'ssh -p 2201' /home/nathan/source/
> nathan at lint-1:/home/nathan/destination --progress --stats --compress
> --delete
> Missing trailing-' in remote-shell command.
> rsync error: syntax or usage error (code 1) at main.c(335) [sender=2.6.8]
> [nathan at linux-fs2 scripts]$
>
>  Try this line:
>
> /usr/bin/rsync -av -e "ssh -p 2201" --delete --compress
>  /home/nathan/source/ nathan at lint-1:/home/nathan/destination/
>
>
> hth,
>
> -Jim P.


-- 
Bj?rn Gustafsson



More information about the Ale mailing list