Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

net::ftp , ftp program , backup

by Anonymous Monk
on Oct 12, 2001 at 16:02 UTC ( #118450=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

what i want to do :

1)going to a directory /apache/wwwroot/
2)and every file thats in that directory uploading
3)and in that directory there are more directorys and files ...so that uploading too

i have checked :
http://theoryx5.uwinnipeg.ca/CPAN/data/libnet/Net/FTP.html
1) with cwd command
2) maybay with mput * put how should i do that ?
3) no clue
4) maybay a log ?

i'm a newbie but want create that for a sheduled backup

Replies are listed 'Best First'.
Re: net::ftp , ftp program , backup
by echo (Pilgrim) on Oct 12, 2001 at 16:10 UTC
    I'm not sure I quite understand the FTP part of your question, but for backups a great tool is rsync, which can conveniently be used from Perl with File::Rsync.
      sorry its calling resurcive uploading....
      i have already this

      #!/usr/bin/perl> use Net::FTP; $ftp = Net::FTP->new("10.10.10.3", Debug => 0); if ($ftp == undef) { die ("Couldn't open ftp connection, $@\n"); } $ftp->login('test','test'); $ftp->binary; for(<*.*>) { $ftp->put($_); } $ftp->quit;
      That is uploading everything in my current directory !
      just the files ... but if there is also directory's in that
      directory. it is doing nothing. and i want do some logging also any idea ....

      2001-10-13 Edit by Corion : Added CODE tags

Re: net::ftp , ftp program , backup
by perldoc (Scribe) on Oct 12, 2001 at 19:46 UTC
Re: net::ftp , ftp program , backup
by khippy (Scribe) on Oct 12, 2001 at 17:33 UTC

    sitecopy is a convenient way to mirror.
    If you want to try thirdparty software give http://www.lyra.org/sitecopy/ a try.
    They seem to be down, currently, but I haven't heard of any stop of this
    project, and unfortunately freshmeat has an mysql-error, right now. But it *is* a
    good tool: Install, configure, and forget it :)

    --

    there are no silly questions
    killerhippy
Re: net::ftp , ftp program , backup
by earthboundmisfit (Chaplain) on Oct 12, 2001 at 17:13 UTC
    I'm a little confused as to exactly what you wish to do. The way I read it, you want to find all files and subs on the machine where Perl is running and FTP them to someplace else.

    this node provides a good code snippet for how to accomplish the FTP portion.

    To gather all file and sub names, see recurse directories and sub-directories

Hiya, link guy, where'ja wannit? Huh, okey.
by George_Sherston (Vicar) on Oct 13, 2001 at 01:41 UTC
    I confess I don't really understand these topics, but I'm reliably informed in the CB that this thread is related to the present one, and may be worth a look.

    George Sherston

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://118450]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2022-05-29 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (101 votes). Check out past polls.

    Notices?