Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running commands and emailing

Status
Not open for further replies.

jehixson

Programmer
Oct 15, 2003
12
0
0
US
I need a little help with a script.
1. run a find command.
2. telnet to antoher server and run a find command.
3. exit to origianl server.
4. run another find command.
5. run 1 last find command.
6. save all the ouput text to a text file.
7. email to a specific address.

Fairly new but I do know how to set up a crontab to have it ran weekly.
 
And what have you so far ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
as I stated before, I am new to unix scripting so not much. I need to find files, disk status, and volume and plexes then combine them together and send a .txt file via email them to a specific email address. I also need to find the same files on a standby system in which I can telnet to but I am not sure if I should create a file and the FTP it to the active system or not. I need to know the best way.

example of the commands

find / -name core > list1
(sleep 30 seconds) * not sure if this is correct
telnet 255.255.255.0 example only of course
find / -name core > list1.5
(sleep 30 seconds) * not sure if this is correct
ftp list 1.5 active system ip
volprint -A > list2
(sleep 3 seconds) * not sure if this is correct
voldisk -list > list3
(sleep 3 seconds) * not sure if this is correct

cat list1 list2 list3 > compiledlist.txt

I am not sure of emailing through a script and I would need some sleep time between each command listed above.

 
Instead of telnet you may consider remote shell, ie depending of your *nix flavor rsh, remsh or rcmd. If ssh is installed on both computers it's an option too.
For emailing you can try something like this:
mailx -s "Your subject here" somename@somecompany.com < compiledlist.txt
BTW why do want the script sleeps at each stage ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I just threw it in there. I am not sure if it actually needs it. It takes about 15 to 20 and sometime up to 30 seconds to find the "core" files on the system.

Thanks for the help!

 
As long as you don't play with background job (final ampersand & on a command line) the shell waits for completion of the running command before starting a new one.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top