RSS
Home
|
Link Us
|
Contact
Categories
-- All --
Perl
PHP
MySQL
Windows
JavaScript
HTML
Apache
CVS
Linux
SEO
Perl (9)
PHP (35)
MySQL (5)
Windows (7)
JavaScript (5)
HTML (6)
Apache (6)
CVS (4)
Linux (13)
SEO (11)
The registration is temporarily disabled.
However you can post your comments without registration.
Authentication
Username:
Password:
Register
|
Lost password
-->
Ftp backup perl script
Home
»
Perl
»
Ftp backup perl script
Date: 2008-07-15
This ftp backup perl script transfers backup files to a remote FTP host one file at a time.
Download
|
Printer Friendly
Add to Google
Add to Del.icio.us
Add to Digg
Add to Technorati
Add to Yahoo!
Add to Blinklist
Add to Furl
Add to reddit
#!/usr/bin/perl # Transfers backup files to a remote FTP host one file at a time. # Remote "backup/" folder must exists. # Usage: $0 file.tar.gz # Author: Svetoslav Marinov [slavi at slavi dot biz] # http://devquickref.com # July 2008 use strict; use Net::FTP; die("File not supplied") unless @ARGV; # Settings my ($host, $user, $pass, $dir) = ("ftp.somedomain.com", "user", "pass", "backup/"); my $file = shift(@ARGV); my $ftp = Net::FTP->new($host, Debug => 0, BlockSize => 50 * 1024) or die "Cannot connect to some.host.name: $@"; $ftp->binary(); $ftp->login($user, $pass) or die "Cannot login ", $ftp->message; $ftp->cwd($dir) or die "Cannot change working directory ", $ftp->message; print "Uploading file $filen"; $ftp->put($file) or die "put failed ", $ftp->message; $ftp->quit; exit(0);
Comments
No comments yet.
Post a comment
Your Name
Your Email
(won't be published)
Site
(e.g. http://)
*
Title
*
Comment
*
Required fields.
Copyright © 2005-2009
Execution time: 0.07723
hosted by
1and1