LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-01-2005, 03:21 AM   #1
yuva_mca
LQ Newbie
 
Registered: Oct 2003
Posts: 21

Rep: Reputation: 15
shell script to check ftp communication


Hi,

I need the script which suppose to check the ftp communication. script has to execute 3 times daily and script suppose to login to ftp server using username with password. If ftp works also it has to send the mail and even if it is fail also it suppose to send the mail. I have wrote the below script, while executing this script it is asking the password manually. But the password is not taking which we mention in the script. Please suggest the same or write the script and let me. It would be great help for me.

Thanks
Yuva

ftp script:-

ftp<<**
open 192.1.1.1
anonymous
ls
**

Last edited by yuva_mca; 12-01-2005 at 03:24 AM.
 
Old 12-01-2005, 03:35 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You can use your script with a regular user, creating the file .netrc in the user's homedir (~/.netrc), with the following contents:
Code:
machine  192.1.1.1
login    usename
password user-passwd
 
Old 12-01-2005, 07:15 AM   #3
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
This works for me:

Code:
#!/bin/sh
/bin/ftp -n << "EOS"
open machine
user myuser mypass
cd remote_dir
lcd local_dir
get "file"
EOS
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Script to check root user? kushalkoolwal Programming 4 09-22-2005 12:15 AM
How to check ICMP code through shell script? Thakowbbery Linux - Networking 2 07-19-2005 09:52 AM
Shell script ip address format check. rooch84 Linux - Software 6 08-18-2004 09:14 AM
Communication between shell script and program ZooL Programming 6 08-14-2004 05:44 AM
Shell-Script check if $xx is of type integer d-fens Programming 5 07-11-2003 08:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:54 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