LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-28-2012, 07:26 PM   #1
Linux_420
LQ Newbie
 
Registered: Dec 2011
Distribution: Fedora
Posts: 27

Rep: Reputation: Disabled
Question lftp scripting


I am attempting to write an lftp script that mirrors directories to a remote server. The main problem I have is that I can not be sure weather or not the "verify-file" script included with lftp is executing.

I've issued the following commands after establishing a connection via an expect script:

Quote:
set xfer:verify yes
Quote:
set xfer:verify-command "/usr/share/verify-file" yes
I am on Fedora so the path to that script is correct.

The "verify-file" script is a perl script & I know very little about perl. Perhaps I could make a copy of the file & set it as verbose to ensure that it is indeed being executed. I uploaded a large file to see if there was a pause after the transfer was complete. There was no difference between a file that was a few kb in size or one that was several hundred mb.


EDIT: I've changed other "xfer:*" settings to test things like remote directory and they work. I also realized lftp has a status during transfers that tells what it's doing (i.e. "changing remote directory")

I have tried running lftp from both root & a regular user from the client.

I guess I should ensure the open-ssl libs were used during the compile of lftp. I did not compile it myself so, as with everything else this is turning into something complicated. Will continue to update my progress &, if I ever get it to work, the script itself.

Last edited by Linux_420; 07-29-2012 at 12:55 PM.
 
Old 07-29-2012, 06:30 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,167

Rep: Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680
You could do a test by running a script on the target system that messes with the incoming dir
 
1 members found this post helpful.
Old 07-30-2012, 10:32 AM   #3
Linux_420
LQ Newbie
 
Registered: Dec 2011
Distribution: Fedora
Posts: 27

Original Poster
Rep: Reputation: Disabled
I suppose that would ensure the server is capable of running the script. I assumed that the client was the machine running it I put lftp in debug mode but that didn't help much. I checked to see which libraries were installed and neither openssl nor gnu tls showed up but I can seein debugging mode that the connection is secure. I tried setting the xfer:verify boolean with both yes and true. The xfer: verify setting will not allow me to set the path to the verify script as anything other than
"/usr/share/lftp/verify-file" even when lftp is run as root. That should not be a problem though. I thought about compiling lftp from source but seeing as the connection is secure even without the ssl or tls libs i doubt that is the problem, though it may be. Perl is doing the check sums anyway. I did install more peel modules to extend support for md5 but the script isn't even running. Perhaps lftp wasn't set up to run the perl script? I think it is executed within the lftp shell because the script has to know what files or directories to verify.
 
Old 07-30-2012, 08:04 PM   #4
Linux_420
LQ Newbie
 
Registered: Dec 2011
Distribution: Fedora
Posts: 27

Original Poster
Rep: Reputation: Disabled
Oh i get what you're saying....good idea. I will try that.
 
Old 07-30-2012, 11:34 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,167

Rep: Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680
Also (lateral thinking) if you used scp instead of lftp, scp is very reliable. In fact, I think it checksums stuff anyway during the decrypt at the other end?
If you are using Perl, there are modules for ssh etc. You could do an ssh login after copying and run md5sum or similar.
Just a thought...
 
Old 08-10-2012, 04:11 PM   #6
Linux_420
LQ Newbie
 
Registered: Dec 2011
Distribution: Fedora
Posts: 27

Original Poster
Rep: Reputation: Disabled
Well i would use scp but I've got files larger than 4GB on my hard drive. Also i intend to encrypt the files before transferring them. I started using md5deep then used md5sum and finally decided to use openssl to create signed checksums. I am just using an expect script with ftp, ssh, openssl, and i will have to do something to archive some directories but that will be a separate task. I have over 2TB of stuff to get off this raid so i can fix it and I'd like to start keeping off site backups anyway so this should help me set that up whenever i find time to get it done.
 
  


Reply

Tags
ftp, lftp, md5, script, verify


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
regarding lftp santhosh-e Linux - Software 3 01-03-2012 09:22 AM
lftp mikeshn Linux - Software 11 07-20-2011 12:44 PM
lftp HELP knappster Linux - Software 2 08-03-2004 10:34 AM
lftp Scripting kittani Linux - Software 1 06-19-2004 11:28 AM
about lftp oskernel Linux - Software 1 10-29-2003 02:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration