Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

backing up files from a remote server to local pc.

Status
Not open for further replies.

davef101

MIS
Mar 3, 2006
34
GB
how do i go about automatically backing up a directory held on a remote server, to a local pc?
 
What platform/OS are you using? You can use a cron to tar/zip the dir and FTP it to the desired location (UNIX) or task schedular (Windows)
 
The remote server is Linux, but i don't have access total access, as its a paid web host.

The pc is windows xp.

I was thinking along the lines of a script running on the server to copy the files to the pc ( ip addy ).
 
do you FTP access and can copy files back to the PC, there you can zip them up, as needed...may be?
 
yes i can FTP, but i want it done automatically. say, end of the month for example
 
If you have Active perl loaded, use ppm to load the Net::FTP module to create a script and schedule it to be ran when ever you need.

Code:
use Net::FTP;

    $ftp = Net::FTP->new("some.host.name", Debug => 0)
      or die "Cannot connect to some.host.name: $@";

    $ftp->login("anonymous",'-anonymous@')
      or die "Cannot login ", $ftp->message;

    $ftp->cwd("/pub")
      or die "Cannot change working directory ", $ftp->message;

    $ftp->get("that.file")
      or die "get failed ", $ftp->message;

    $ftp->quit;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top