#1  
Old 30th May 2006, 19:03
mcrosby mcrosby is offline
Junior Member
 
Join Date: May 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default ftp shell script

hello everyone,
i have developed a shell script to connect through ftp to a remote server. I was able to get the ftp working and automatically transfer files. Now what i am trying to do is download files from the remote server and then compare those files to the files located in a folder on my local drive. If the files are not equal i want it to output an error to a file or if they are equal show that the operation completed successfully. Anyone have any ideas or can point me in the right direction?
Reply With Quote
Sponsored Links
  #2  
Old 31st May 2006, 00:14
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

You can use the md5sum command and compare the MD5 hashes of the files. If they are not identical, then the files differ.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 31st May 2006, 13:42
mcrosby mcrosby is offline
Junior Member
 
Join Date: May 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am not sure how to use the md5 hashes as I am fairly new to shell scripting do you have any references websites or could you get me started?
Reply With Quote
  #4  
Old 31st May 2006, 14:34
mcrosby mcrosby is offline
Junior Member
 
Join Date: May 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok i seem to have the diff script working on its own and it records the differences to a file. How would i go about combining my ftp script and my diff script because if i end the ftp script it closes out the script entirely.
Reply With Quote
  #5  
Old 1st June 2006, 00:33
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Quote:
Originally Posted by mcrosby
do you have any references websites or could you get me started?
Have a look here: http://www.tldp.org/LDP/abs/html/index.html
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 11th June 2006, 09:07
EvanCarroll EvanCarroll is offline
Junior Member
 
Join Date: Jun 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by mcrosby
hello everyone,
i have developed a shell script to connect through ftp to a remote server. I was able to get the ftp working and automatically transfer files. Now what i am trying to do is download files from the remote server and then compare those files to the files located in a folder on my local drive. If the files are not equal i want it to output an error to a file or if they are equal show that the operation completed successfully. Anyone have any ideas or can point me in the right direction?
This shoulden't require a script at all, you are reinventing the wheel.

Please see `man wget` and -m
Reply With Quote
  #7  
Old 6th January 2007, 14:14
urnetmate urnetmate is offline
Junior Member
 
Join Date: Jan 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default code to connect ftp shell script

Quote:
Originally Posted by mcrosby
hello everyone,
i have developed a shell script to connect through ftp to a remote server. I was able to get the ftp working and automatically transfer files. Now what i am trying to do is download files from the remote server and then compare those files to the files located in a folder on my local drive. If the files are not equal i want it to output an error to a file or if they are equal show that the operation completed successfully. Anyone have any ideas or can point me in the right direction?

Please telll me code for shell script to connect ftp.
Waiting for replay..
Thanks in advance
Reply With Quote
  #8  
Old 8th January 2007, 10:20
urnetmate urnetmate is offline
Junior Member
 
Join Date: Jan 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko
I am getting error "Passive mode refused" on mget shell command

Please help..

Thanks in Advance
Reply With Quote
  #9  
Old 9th January 2007, 15:12
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
 
Default

Quote:
Originally Posted by urnetmate
I am getting error "Passive mode refused" on mget shell command
Do you mean wget?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help for writing shell script chris_87 Programming/Scripts 7 4th April 2007 15:50
Need help for writing shell script erez Programming/Scripts 4 16th June 2006 14:23
Perl and cgi script installation linuxuser1 General 30 26th April 2006 23:09
Shell nveid General 5 27th March 2006 14:49
Shell script is broken... Duplex Installation/Configuration 4 16th January 2006 09:55


All times are GMT +2. The time now is 03:53.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.