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!

Script

Status
Not open for further replies.

AIXUser53

IS-IT--Management
Aug 16, 2002
47
0
0
US

Hi Guys,

I am trying to write an script to tail the last 1000 line of a file and send it to me by email. I have tried to write scripts but it does not work. Can anyone help me?
I already have setup the connection between the RS6000 and my exchange server.


Thank you in advance.
 
1. tail -100 filename > file4mail
2.mail -s &quot;test&quot; your@mail.com <file4mail
Is this working?
 
That script works if I run it manually. But when I try to run the script from the crontab it gives me the following error:

sh: 1st.bmp: not found.

I am not sure why it is doing this. hear is the script i have.

tail -1000 /db1/KK.lg > /tmp/kklg.log
mail -s &quot;Log File&quot; @mail:xxxxx@xxx.com < /tmp/kklg.log

Any Idea?

Thanks again.
 
Here it is:
The last line is the line I added to run the script.

02 22,7,12,16 * * * /usr/igs/scripts/aicron.sh -i HS -i Q1 -m dba -p mis 1>/dev/null 2>/dev/null
20 22,7,12,16 * * * /usr/igs/scripts/rollcron.sh -i HS -i Q1 -m dba -p mis 1>/dev/null 2>/dev/nul
15 0 * * * /usr/igs/scripts/purgerpt.sh -d 1 1>/dev/null 2>/dev/null
05 0 * * * /usr/igs/scripts/dbmon.sh 1>/dev/null 2>/dev/null
7 13 * * * * /usr/ITScripts/kklg.sh

 
HI,

You have one &quot;*&quot; too many ... :

7 13 * * * * /usr/ITScripts/kklg.sh

Should be:

7 13 * * * /usr/ITScripts/kklg.sh

&quot;Long live king Moshiach !&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top