One potential issue is that you probably have two Perl installations: Cygwin's Perl and ActiveState's ActivePerl. However, I'm suspecting that your issue has nothing to do with Perl. If you can't type the command at a command prompt (or in a Cygwin prompt) and get it to work properly, then calling the exact same command from Perl won't work.
What has me a bit confused is that in your first post, you have:
my $command =
"c:\\cygwin64\\bin\\rsync.exe -ashv -e plink $user\@$host:/var/log/s
+a/sar* .";
Then in your last post, you have:
C:\cygwin64\bin\rsync.exe -ashv -e plink --exclude=aide.log --exclude=aide_error.log weaverw@10.3.30.149:/var/log/aide
The most recent version includes two '--exclude=' options in the command. The last option before those is a '-e' option. Looking at the documentation for rsync, the '-e' option does not have any suboptions. However, the '-F' option does allow for using an '--exclude' sub option, but there is no '-F' option in your command. Also, the documentation for plink does not show any '--exclude' options.
Also, if I'm reading things correctly, the shorter command in your OP has a remote directory ($user\@$host:/var/log/s
+a/sar*) and a local directory (.), but your second post shows an rsync command with only a remote directory (weaverw@10.3.30.149:/var/log/aide). According to the rsync documentation: "You use rsync in the same way you use rcp. You must specify a source and a destination, one of which may be remote." It looks like you're missing the local directory.
Are you sure that you have your rsync command call correct?
My suggestion would be to try to figure out the proper syntax of the rsync command that you're trying to run and then update your Perl script with the correct syntax for the command call. |