> i want to automatically mirror the site onto our isp
> ftp:\\ftp.myisp.com/~myid/html
> 
> the programs i've seem bring sites down not upload them
> can i have some suggestions please

Try scripting Steve. This pretty basic script should help you 
get started if you know Perl. Where it says "your file 
processing here" put an external invocation to FTP or an 
smbclient program.

You can also use the LWP or Net:FTP packages
(depends on your Perl install) 

Regards,
-Sonam



----------------------------------------------------------
#!/usr/bin/perl
use strict;

# This uses a recursive routine to do a depth first processing 
# of the directory hierarchy. Make sure that file permissions 
# are in place and NO SYMLINKS EXIST (otherwise you risk endless 
# processing of your filesystem)

thisdir ("."); # the initial call to the recursive subroutine

sub thisdir () {
        my ($t, @allfiles, @alldirs, @realdirs, $jnk);
        ($t) = @_;
        opendir THISDIR , $t or die "Could not open directory: $t : $!";
        @allfiles = grep -f,  readdir THISDIR;
        #   Do your file processing here, i.e. FTP uploads, right here.
        #       print "\nHAHAHA! THESE ARE YOUR FILES:\n @allfiles\n";
        # e.g.: `smbclient '\\mc\s' -d0 -W NT_DOM -I 242.128.10.11 -U xyz -c "cd data; 
ls $a" >> logfile`

        closedir THISDIR;
        
        # Get the directory names for the recursive calls below
        opendir THISDIR , $t or die "Could not open directory: $t : $!";
        @alldirs = grep  -d, readdir THISDIR;
        @realdirs = grep !/^\.\.?$/ ,@alldirs;
        print "\nHAHAHA! THESE ARE YOUR DIRS:\n @realdirs\n";
        closedir THISDIR;

        # for each directory in current directory, go down in it
        # then make a recursive call to thisdir()
        # and when all calls have returned come back up 
        # and return control to the caller subroutine
        foreach (@realdirs) {

                $jnk = `pwd`;
                chomp $jnk;
                print "\nNow descending into ".$jnk."/".$_."\n";
                chdir $jnk."/".$_;
                print "\nCurrent directory is ".`pwd`;

                thisdir(".");
        }
        print "\nAscending directory";
        chdir "..";
        print "\nCurrent dir: ".`pwd`."\n";
}


--------------------------------------------------------


[EMAIL PROTECTED] wrote:
> 
> i have my users make the web site locally
> \home\site
> 
> i want to automatically mirror the site onto our isp
> ftp:\\ftp.myisp.com/~myid/html
> 
> the programs i've seem bring sites down not upload them
> can i have some suggestions please

> i'd like to run as a cron job daily at 11:06 or whatever
> 
> regards
> stephen
> 
> --
> SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
> More Info: http://slug.org.au/lists/listinfo/slug

-- 
Sonam Chauhan
Electronic Commerce
Corporate Express Australia Ltd.
Phone: +61-2-9335-0725 Fax: +61-2-9335-0753


--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to