BINGO. Unintended interpolation of the "@localhost" as an array instead of as a literal string. Thanks Brian!

Jim Salter
JRS Systems

> Brian Cross wrote:
>
Jim,

No idea's off hand, but set the -w debug option at the top of the script
and see if it gives you more information regarding the error.

#!/usr/bin/perl -w

Brian.....

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jim Salter
Sent: Wednesday, May 05, 2004 2:31 PM
To: [EMAIL PROTECTED]
Subject: rsync and Perl programming

Hi everybody -

I'm trying to write a Perl wrapper for some rsync tasks that need doing.

Problem is, there's some sort of odd interaction going on between Perl

and the daemon mode communication for the rsync client, and I'm at my wit's end in trying to figure it out.

Here's the Perl script:

#####################################################
#####################################################
#!/usr/bin/perl
$rsync_cmd = "/usr/local/bin/rsync -a --progress --password-file=/usr/local/etc/rsyncd.passwd [EMAIL PROTECTED]::samba/rsynctestfiles
/usr/share/smbshare/rsynctestfiles";


$pid = open(PH, "$rsync_cmd 2>&1 |");     # with an openpipe
while (<PH>) {                            # plus a read
         print $_;
}

print "finished\n";


##################################################### #####################################################



When I run the script, here is the output I get:


##################################################### #####################################################

building file list ...
link_stat "/usr/share/smbshare/Work/rsync-backup-v2/ph34r/rsynctestfiles" failed: No such file or directory
0 files to consider


wrote 25 bytes  read 20 bytes  90.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files could not be transferred (code 23) at
main.c(632)
finished


##################################################### #####################################################

Now the odd thing is, I can run the rsync command in $rsync_cmd just fine from the shell - it rsyncs the directories in question without problem. And if I set $rsync_cmd to something using a local path (no daemon-mode communication) for both source and target, it will run as expected in my Perl script too.

I'm only having the odd problem shown when using daemon mode in my Perl wrapper. The system being used is running FreeBSD 5.1, and I have the problem when running either rsync 2.6.0 from FreeBSD's ports tree or 2.6.2 downloaded straight from the rsync site and compiled.

Any ideas? (Help me, help me obi-Wayne...)

Jim Salter
JRS Systems

-- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to