|
Jan 07
2010
|
The built-in functionality of your plain ol' FTP client doesn't extend to recursively parsing directories and uploading them to a remote machine. We use lftp to clone our production environment periodically to refresh our development environment. It's also really useful for migrating your site from host to host.
lftp works similarly to ftp so you shouldn't feel too lost when you fire it up.
$ lftp username@hostname
And here's where lftp really shines - you can use the mirror command to recursively parse a remote site and download it locally, or use mirror -R to reverse the action and upload all your local content to a remote machine. Just be careful - it doesn't ask for confirmation, so it's really easy to launch it in the wrong direction and blow away all your hard work.
To download a remote file tree just lcd and cd your way to the correct working directories and execute:
> mirror
To do the same thing in reverse, uploading your local content to a remote server:
> mirror -R
As usual there's lots more information in the man pages. Enjoy!
Also see my blog post on using mysqldump and mysql to replicate your MySQL database from host-to-host.