Sync remote directory with local and update local directory if there is any changed.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ketanm
    New Member
    • Aug 2010
    • 8

    Sync remote directory with local and update local directory if there is any changed.

    Hi,
    I have to Sync remote directory with local directory and changed according to update which i got in remote directory using tcp only.please tell me how can i do this in perl.i m totally new to this.

    Thanks,
    ketan
  • RonB
    Recognized Expert Contributor
    • Jun 2009
    • 589

    #2
    Use the rsync utility.


    File::Rsync - perl module interface to rsync(1) http://rsync.samba.org/rsync/

    Comment

    • ketanm
      New Member
      • Aug 2010
      • 8

      #3
      hi

      Hi ron,
      thanks for your reply.i am also trying form this http://search.cpan.org/~prashant/Win...EAutomation.pm.


      Thanks,
      ketan

      Comment

      • RonB
        Recognized Expert Contributor
        • Jun 2009
        • 589

        #4
        Based on your posted question, your use of Win32::IEAutoma tion doesn't make any sense.

        Please give more details of what you need to accomplish and the code that you're attempting to use to accomplish that task.

        Comment

        • ketanm
          New Member
          • Aug 2010
          • 8

          #5
          Hi

          hi ron,
          thanks for your reply.this is the site http://hg.sagemath.org which has mercurial repository.i have to collect all name tags first and when you click one of the name tags respective link gets open which has all files or directory which i need to copy to local directory if there is any changed.
          my setp will be as below.
          1.login to the merecurial site.
          2.get the name tags.
          3.get link with refer to name tag.
          4.sync with local direcoty to files and copy if there is changed.

          Please let me know how could i achieve this?

          Thanks,
          ketan

          Comment

          • ketanm
            New Member
            • Aug 2010
            • 8

            #6
            hi

            hi,
            i solved this.
            below is the code to do this all above step.

            Code:
            use Win32::IEAutomation;
                   
                   # Creating new instance of Internet Explorer
                   my $ie = Win32::IEAutomation->new( visible => 1, maximize => 1);
                   
                   # Site navigation 
                   $ie->gotoURL('http://hg.sagemath.org');   
                  
                  print "enter tag: " ;
                  chomp($tag=<>);
                  print " tag is $tag " ;
                  
                     
                 $ie->getLink('linktext:',$tag)->Click; 
                  print "enter tag number: " ;
                  chomp($tagnumber =<>) ;
                   
                  $url=$ie->getLink('linktext:', qr/$tagnumber/)->linkUrl;
                  print "url is $url";
                  $ie->gotoURL($url);
                  
                 chdir('C:\Example');
                 print "changed to path C:\Example ";
                 
                 print `dir`;
                 
                 @args = ("hg", "clone", "$url");
                 
                 system(@args)== 0
                            or die "system @args failed: $?"
            Last edited by numberwhun; Aug 19 '10, 12:10 AM. Reason: Please Use CODE TAGS!

            Comment

            Working...