|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Can any1 help me?
I have two sites, 1st - with cgi-bin, primary site and 2nd with ftp access but without cgi-bin, but i need to back-up my files from 1st to 2nd. How can i connect to second'z site ftp server and post some files from 1st thru cgi/perl script... And i have only standart perl modules such socket and so on. Plz help me Thanx KraZy TeAcheR |
|
#2
|
|||
|
|||
|
I assume you are hosting your sites somewhere. Check with your 1st host and see if they have libnet-1.0703.tar.gz installed. You need FTP.pm.
Also, 1) depend on how much disk space you have on both Server1 and Server2. 2) Can you run cron on server1 3) how much data you want to backup If no cron allowed, I would write a script which should do the following and to be executed daily/weekly or whenever. 1) Create a tarball of your Server1's site 2) Use FTP.pm and upload this tarball (using your system time as the tarball file name) to Server2 3) Then delete this tarball on your Server1 Anyway, if your 1st host has FTP.pm installed, you can grab libnet-1.0703.tar.gz from -> http://www.perl.com/CPAN-local/modules/by-module/Net/libnet-1.0703.tar.gz and read thru it and see how it works. Using FTP.pm, you can even upload files from Server1 to GeoCities. |
|
#3
|
|||
|
|||
|
Use Net::FTP if it's installed (should be, it's part of the standard dist.). Check out perldoc Net::FTP for more details. Basically, you just create an FTP object and access everything through that. Examples are in the docs.
|
|
#4
|
|||
|
|||
|
Damn,
how can i know what i have? At my other server i try to use command "perl -MFTP -e" in ssh-client but it says "no code specified for -e". So how can i know? May be thru some perl-script? My server's other params 1st - 100mb/cgi/php/ssi 2nd - 32mb 3d - 20mb/cgi/ssi/(probably cron)/ssh I need to back-up some filez ~3-8 mb size when no have many free space in 1st(or 3d)! So no need to use cron. Its no need to make tarball... Thanx KraZy TeAcheR |
|
#5
|
|||
|
|||
|
You can tell whether a module is installed by typing:
perl -MModuleName If the module isn't installed, you'll get an error message saying "Can't locate <ModuleName> in @INC: " and then a dump of your current @INC. You can also try: perl -MModuleName -e "print $ModuleName::VERSION" to get the version of the module. Note that ModuleName needs to be the FULL module name, not just the last bit -- i.e. when checking for Net::FTP then ModuleName is Net::FTP, not just FTP. If the module is not installed, you can always install it locally: Go to CPAN (perl.com/CPAN) and download Net::FTP (or Net::Bundle). Follow the readme instructions to install it (use something like ~/perl/lib as your root). Now, when you want to use the module, you can just add the line: use lib "$ENV{HOME}/perl/lib"; before putting in use Net::FTP |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Do any1 know how? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|