[Bloomington-normal-pm] Net::SFTP

Erik Costlow erik at uhacc.org
Mon Aug 9 11:14:19 CDT 2004


I am writing a script to transfer backups from a remote server using the
Net::SFTP module.
http://search.cpan.org/~drolsky/Net-SFTP-0.08/lib/Net/SFTP.pm

I'm a bit confused as to how the do_open function works in returning its
value.
The following code always dies (the directory does exist).
opendir(MAINDIR, $sftp->do_open("/mount")) or die...

  -Erik

Pseudo-code of the final project (in case it helps anyone get a better
understanding of the question)
Log in to backup server
cd to /mount/ #not /mnt
for each folder
	next if the name doesn't begin with d
	cd to $folder/backup
	for each folder2
		cd to $folder2/data
		for each file
			loop through, find the highest modification time
			Print the name and download the file
		loop
	loop
loop

-- 
Costlow Corporation
http://www.costlowcorp.com


More information about the Bloomington-normal-pm mailing list