Hi Michael,

Thanks for your reply.

What I am trying to do is chose a list of files from the HTML browser page
(checkboxes) that I want to update.

For example:  Here is a list of files that are off sync at the production
server, but I chose to only update two of the tested files "FOLDER.GIF" and
"HTMLFILE.GIF" immediately under the main directory
(/usr/local/apache/htdocs-www-live).  The problem is, the rest of the file
with the same name within the sub-directories get updated as well.  I am
dynamically creating the rsync string in my CGI program like so:

      $in_excludeFiles = " --include \"*\/\"  ";
      foreach ( 0..$#keyArray ) {
          chomp($_);
          my $file = "$keyArray[$_]";
          if ( $file =~ m/deleting/ ) {
            ($filler, $file) = split (/ /,$file);
            }
          $in_excludeFiles .= " --include \"$file\"  ";
          }
      $in_excludeFiles .= " --exclude \"*\"  ";
      setRsync();
      open(RSYNC, "$rsync |");
      while (<RSYNC>) {

So the rsyn string becomes:

/usr/bin/rsync --delete -gHloprtv --include "*/" --include
"FOLDER.GIF" --include "HTMLFILE.GIF" --exclude "*"
/usr/local/apache/htdocs-www/ /usr/local/apache/htdocs-www-live 2>&1

FOLDER.GIF  <===  I only want these two files...
HTMLFILE.GIF  <===  I only want these two files...
archive/FOLDER.GIF
archive/HTMLFILE.GIF
archive/channels/FOLDER.GIF
archive/channels/HTMLFILE.GIF
banners/FOLDER.GIF
banners/HTMLFILE.GIF
banners/cbsmarketwatch/FOLDER.GIF
banners/cbsmarketwatch/HTMLFILE.GIF
banners/cnet/FOLDER.GIF
banners/cnet/HTMLFILE.GIF
banners/flash/FOLDER.GIF
banners/flash/HTMLFILE.GIF

Thanks.

Peter

-----Original Message-----
From: Michael Bramer [mailto:[EMAIL PROTECTED]]
Sent: Saturday, September 16, 2000 2:46 AM
To: Peter Loo
Cc: [EMAIL PROTECTED]
Subject: Re: I don't want to recursively copy the same file in all
sub-directories...


On Fri, Sep 15, 2000 at 05:05:04PM -0700, Peter Loo wrote:
> I only want /usr/local/apache/htdocs-www/FOLDER.GIF to copy to
> /usr/loca/apache/htdocs-www-live/FOLDER.GIF.  I don't know why
the same file
> "FOLDER.GIF" is getting copied to all the sub-directories.  They
do exist in
> the destination sub-directories, but I only want to replace one.
>
> Please help!
>
> /usr/bin/rsync --delete -gHloprtv --include "*/" --include
> "FOLDER.GIF" --exclude "*" /usr/local/apache/htdocs-www/
> /usr/local/apache/htdocs-www-live 2>&1
>     FOLDER.GIF
>     archive/FOLDER.GIF
>     archive/channels/FOLDER.GIF
>     banners/FOLDER.GIF
>     banners/cbsmarketwatch/FOLDER.GIF
>     banners/cnet/FOLDER.GIF
>     banners/flash/FOLDER.GIF
>     banners/gamespy/FOLDER.GIF
>     banners/go2net/FOLDER.GIF
>     banners/softseek/FOLDER.GIF
>     banners/trailer/FOLDER.GIF
>     business/FOLDER.GIF
>     business/advertising/FOLDER.GIF
>     business/advertising/media_kit/FOLDER.GIF
>     business/advertising/media_kit/image/FOLDER.GIF

use:

/usr/bin/rsync /usr/local/apache/htdocs-www/FOLDER.GIF
        /usr/local/apache/htdocs-www-live/FOLDER.GIF

and all is ok.


Gruss
Grisu
--
Michael Bramer  -  a Debian Linux Developer http://www.debian.org
PGP: finger [EMAIL PROTECTED]  -- Linux Sysadmin   -- Use Debian Linux
"Wie haben andere Linux Benutzer ihr `erstes Mal' mit Linux erlebt??"
"Wir haben danach gemeinsam eine Gitanes geraucht und nochmal ueber alles
 geredet." -- P.Vollmann und Stefanie Teufel in dcolm


Reply via email to