Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Using Net::FTP to recurse directories and retreive files

by filmo (Scribe)
on Jun 18, 2001 at 00:54 UTC ( [id://89195]=perlquestion: print w/replies, xml ) Need Help??

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

Hi, I'm fairly new to Perl and Unix servers. Having searched the various post here regarding Net::FTP, I found that most involved the client already knowing the exact names and directories of the files they were trying to transfer.

What I need it the ability to move an entire website with its' directory struture and file locations intact from one server to another. Since the site is large, I would like to simply supply the root directory of the oldsite (i.e. 'home/hostingISP/oldwebsite/') and the new root directory (i.e. 'home/betterISP/transferedsite/'') and have the program take care of everything from that point.

This seems like such an simply procedure, but I'm not clear on how to read the directories and recurse through them and at the same time rebuild the structure on the client.

If I'm reinventing the wheel here, please point me to the ready made tires. P.S. while the new server has the Net::FTP module installed, it does not allow ftp from the shell. Thus I can't simply do this from the command line.
--
Filmo the Klown

  • Comment on Using Net::FTP to recurse directories and retreive files

Replies are listed 'Best First'.
Re: Using Net::FTP to recurse directories and retrieve files
by grinder (Bishop) on Jun 18, 2001 at 01:47 UTC
    If I'm reinventing the wheel here, please point me to the ready made tires

    hey, why not drive off in a limo! Check out fsync, the file synchroni[sz]ation utility. Of course, you won't be any further advanced in learning how Net::FTP works, but at least you'll get your job done... which will therefore give you more time to spend learning other bits and pieces about Perl...
    --
    g r i n d e r

Re: Using Net::FTP to recurse directories and retreive files
by Hero Zzyzzx (Curate) on Jun 18, 2001 at 02:44 UTC

    There was a recent discussion of this here.

    HTH

Re: Using Net::FTP to recurse directories and retreive files
by cajun (Chaplain) on Jun 18, 2001 at 07:39 UTC
    No trying to talk you out of learning Perl, but, the ready made tires are already there for you if you're running Linux. man wget should tell you everything you need.

    Another way would be to go to the old server, tar up the entire directory structure of your site, starting at the root of your site, then scp the tar file from old server to new server.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-25 04:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found