#!/usr/local/bin/perl # Name: # getarchive.pl # # This script grabs a file from a specified ftp location. # # Instructions: # Modify the variables below as needed to pull your # archive files from the remote server. # # Author: # Brennan Stehling (bws) - brennan@offwhite.net # # License: APL # This software is being released under the Anarchist # Public License. You can use your own judgement # in using this code. It is yours to use, modify, # add redistribute as you see fit. No warranties # apply to this software. ;) Afterall, it is just # a script and I just wrote this to see if anyone # would actually read the license. Did you? ### use strict; use Net::FTP; my ( $site, # the server where the archive is located $dir, # the location of the archive on the server $login, # username for remote access $pass, # password for remote access $ftp, # ftp object $archive, # name and location of archive file ); $site = 'server.somewhere.com'; $archive = '/backups/archive.tar.gz'; $login = 'user'; $pass = 'pass'; # log into site $ftp = new Net::FTP ($site) or die "Can't connect: $@\n"; $ftp->login($login, $pass) or die "Can't log in: $@\n"; # download the archive $ftp->get($archive); exit 0;