link_stat

livau at gmx.net livau at gmx.net
Sat Jul 23 12:40:08 GMT 2005


Hi there,

I set up my company's back up server using rsync.
And I've got a strange problem. I searched in the archives of this  
list, but
none of them seems not giving me an idea to solve the problem.
If anyone can help, it would be grateful.

I'm using cron by a user (non wheel/admin) to rsync everyday during  
the night.
The cron is set in the server to transfer the backing-up directories  
to a remote server.

My shell script is as follows.

I make up the proper command by the script. The user is authenticated  
by RSA non password.
The problem is,
I can run successfully with the command, which was produced by the  
script, from the command line.
But if I run this script from cron or run this script on command  
line, link_stat error occurs.
The directory /home/auser/ is the current directory when the command  
is run.
How can I get rid of that?
I tried "::" instead of single colon.
I don't use rsyncd.conf file, because I think it runs as non daemon  
process.

This is a single command for back-up:
rsync -auzv -e ssh --delete --exclude=".*" --exclude="~*"
      /work/data my.remote.domain:/ftproot/friday >> friday.log

Any comment would be appreciated.
A. Uchida


Error message:
> rsync: link_stat "/home/auser/my.remote.domain:/ftproot/friday"  
> failed: No such file or directory (2)
> rsync: link_stat "/home/auser/>>" failed: No such file or directory  
> (2)
> done
> ERROR: destination must be a directory when copying more than 1 file
> rsync error: errors selecting input/output files, dirs (code 3) at  
> main.c(412)
> rsync: connection unexpectedly closed (8 bytes received so far)  
> [sender]
> rsync error: error in rsync protocol data stream (code 12) at io.c 
> (434)



my script;

> #!/bin/sh
>
> bDir="/work/data"
> rSvr="my.remote.domain"
> rDir="/ftproot/"
> attr="-auzv -e ssh --delete --exclude=\".*\" --exclude=\"~*\""
>
> case `date +%a` in
>   Mon)
>     tDay="sunday"
>     yDay="saturday";;
>   Tue)
>     tDay="monday"
>     yDay="friday";;
>   Wed)
>     tDay="tuesday"
>     yDay="monday";;
>   Thu)
>     tDay="wednesday"
>     yDay="tuesday";;
>   Fri)
>     tDay="thursday"
>     yDay="wednesday";;
>   Sat)
>     tDay="friday"
>     yDay="thursday";;
>   Sun)
>     tDay="saturday"
>     yDay="friday";;
> esac
>
> sufx=">> $tDay.log"
> #command="rsync $attr $bDir $rSvr:$rDir$tDay $sufx 2>&1"
>
> echo `date` > $tDay.log
>
> if test $tDay != "saturday" && test $tDay != "sunday"; then
>   rsync $attr $bDir $rSvr:$rDir$tDay $sufx
> else
>    echo not on duty in a weekend >> $tDay.log
> fi
>
> echo `date` >> $tDay.log



More information about the rsync mailing list