Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 13th October 2011, 19:49
carlosinfl carlosinfl is offline
Member
 
Join Date: Dec 2009
Location: Orlando, FL
Posts: 70
Thanks: 3
Thanked 3 Times in 3 Posts
Send a message via AIM to carlosinfl
Question I Need To Create a Simple Script

I'm trying to create a Linux shell script that calls the following command:

Code:
/opt/rational/base/cots/flexlm.11.8/i386_linux2/lmstat -a
My question is the above command lists some output that I need dumped into a text file and saved as $DATE_$TIME.txt and then I need the server to email that text file to a specific email address.

My confusion is when I create this Linux bash script, do I need to enter the naming / email information into the script itself or should that be omitted from the script itself and specified in the Crontab line? I've never worked with scripts before so I'm not sure what is proper procedure and such.
Reply With Quote
Sponsored Links
  #2  
Old 14th October 2011, 16:21
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

You can do it one way or the other - that's up to you. I think I'd put this into the script.
__________________
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 15th November 2011, 16:50
nbhadauria nbhadauria is offline
Member
 
Join Date: Aug 2010
Location: New Delhi, India
Posts: 79
Thanks: 1
Thanked 13 Times in 13 Posts
Send a message via Skype™ to nbhadauria
 
Default

hi carlosinfl ,

you wouldn't be needed to create a script for this just use this command and pipe it to a file and mail..

/opt/rational/base/cots/flexlm.11.8/i386_linux2/lmstat -a > lmstat`date +%F_%T`.txt; mutt -s "Output of the Command" -a lmstat`date +%F_%T`.txt emailid@domain.com


and the mail will be send to you at emailid@domain.com you just need to make sure that your server can send the mail to your id..
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
cannot create new ssh users for one client wildnux Server Operation 0 9th February 2011 01:10
How to create a script for ISP connection check rytec Programming/Scripts 0 14th January 2011 09:05
Verify email setup meekish Installation/Configuration 28 27th October 2006 15:36
Chrooted SSH apps bkrausz Tips/Tricks/Mods 14 29th August 2006 23:32
apache user/group won't create directory weedguy Installation/Configuration 6 19th September 2005 23:40


All times are GMT +2. The time now is 10:30.


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