Mailing the output which is there in remote server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Mailing the output which is there in remote server
# 1  
Old 08-20-2007
Mailing the output which is there in remote server

Hi all,

I have a script which logs in to the remote server with FTP and with the user id/password and list the files in the path of remote server where thefiles resid.i need to email this output(i.e wether the files are present on not under the path) to my email id. Can u please let me know as to how i go about this..

Thanks in advance for your help.

#!/bin/ksh
ftp -in Remote Server << end-of-input
user Userid password

cd <path in Remote directory where files reside>
verbose
dir
bye
end-of-input
# 2  
Old 08-20-2007
Try this:
Code:
ftp -n nodename <<EOF > t.lis
user username pwd
verbose 
dir
bye 
EOF 

mailx -s 'file list' me@myplace.com < t.lis

# 3  
Old 08-21-2007
I dont see the mail being generated..not sure where the problem is...do u have any idea
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep remote multiple hosts output to local server

Hello all, i'm trying to create a report by greping a pattern on multiple remote hosts and creta a simple report, actually i did this, is ther any better way to do this. #!/bin/bash for host in `cat RemoteHosts` do ssh $host -C 'hostname 2>&1; grep ERROR /var/log/WebServer.log.2019-09-21... (0 Replies)
Discussion started by: charli1
0 Replies

2. UNIX for Dummies Questions & Answers

Executing ksh script to remote server want output on same window

I'm having a brain freeze moment. I've created a ksh script in AIX that ssh's to a remote server, executes some commands, and then logs out. All of this is sent to a file. I then have the script cat the file so i can see the output. Even though the cat command is outside of the remote session part;... (5 Replies)
Discussion started by: seekryts15
5 Replies

3. Shell Programming and Scripting

How to Append the output of a script running in remote server to a file in local server?

Hi guys, So i am in server1 and i have to login to server 2, 3,4 and run some script there(logging script) and output its result. What i am doing is running the script in server2 and outputting it to a file in server 2 and then Scp'ing the file to server1. Similarly i am doing this for other... (5 Replies)
Discussion started by: srkmish
5 Replies

4. Shell Programming and Scripting

How to get the for loop output from a remote server in UNIX shell scripting?

Hi, I am using ksh , when i try to use for loop i am getting the expected output. $for variable in $(ps -fu user | grep -i something/ | grep -i something | grep -v grep | awk '{print $2}');do > grep $variable /tmp/some_path/*/* > done when tried the below to remote server, getting... (4 Replies)
Discussion started by: karthikram
4 Replies

5. Shell Programming and Scripting

output from remote server during execution of a script

How to see the output from remote server during execution of a script ? I am executing a script (ls) from machine 1 but the o/p should be displayed in machine 2. Can I achieve this ? Example:- Machine 1:- # ls Machine 2:- (console) file1 file2 file 3 dir1 dir2 (0 Replies)
Discussion started by: frintocf
0 Replies

6. Shell Programming and Scripting

Remote server's output

Hi All, Can anybody help me, i have 50 servers within a network. For checking the HDD utilization using df -k, Right now i am logging into each server daily and then noting the output. I want that i should be able to run the command in all servers while sitting in single server and getting... (1 Reply)
Discussion started by: varunksharma87
1 Replies

7. Shell Programming and Scripting

rsh help - getting the output of remote script to local server.

Hi, I have a script that runs for an hour. Have to run it on remote server and need the output it produces on the remote server to decide for failure or success. I run it through a Autosys Job which logs the outputs, both 1 & 2. I use the commands 1) rsh <SERVER> 'nohup /tmp/xyz.ksh &' 2)... (5 Replies)
Discussion started by: aster007
5 Replies

8. Shell Programming and Scripting

Remote server file output redirection

Hi, I want ssh to the remote server and then execute ls and redirect the output to the file in remote server itself like ssh root@$server `ls /var/log/users.txt > root@$server:/home/users.txt` Can you please let me know the correct syntax for it. Thanks in advance (2 Replies)
Discussion started by: mohitmoudgil
2 Replies

9. Shell Programming and Scripting

formatting output from a remote server

Hi Unix Gurus, I have the following output from a remote sftp server sftp> cd outgoing sftp> ls . .. archive x001_ameint_BP020F0025_00306_001.zip x001_ameint_DV010F0060_00306_001.zip x001_ameint_DV010F0065_00306_001.zip x001_ameint_DV010F0065_00306_002.zip... (2 Replies)
Discussion started by: ramky79
2 Replies

10. UNIX for Dummies Questions & Answers

Mailing the output which is there in remote server

Hi all, I have a script which logs in to the remote server with FTP and with the user id/password and list the files in the path of remote server where thefiles resid.i need to email this output(i.e wether the files are present on not under the path) to my email id. Can u please let me know as... (2 Replies)
Discussion started by: OSD
2 Replies
Login or Register to Ask a Question