Re: [ilugd] Shell script not running as expected via crontab, runs fine manually !!

2012-02-27 Thread selvamuthukumar v
On Mon, Feb 27, 2012 at 12:26 PM, Amit Sharma amit_...@yahoo.com wrote:
  Hi,

 I have written a following shell script:

 #!/bin/bash
 # Script to check exim mailq at a specified interval
 echo `date`  /adminscripts/logs/eximcount
 echo `exim -bpc`  /adminscripts/logs/eximcount
 if [ `exim -bpc` -gt 0 ]
 then
 cat /adminscripts/logs/eximcount |mail -s Count of EXIM Mailq on Server  
 a.sha...@example.com
 else
 exit 1
 fi


 The above runs fine manually, however when I try to run it through crontab 
 (as root), it DOES run but /adminscripts/logs/eximcount
 gets empty value. When I run it manually it is able to get the correct count 
 like 5, 10 etc.


make sure your scripts works when starting with 'env -'.

___
Ilugd mailing list
Ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd


[ilugd] [SOLVED] Re: Shell script not running as expected via crontab, runs fine manually !!

2012-02-27 Thread Raj Mathur (राज माथुर)
On Monday 27 Feb 2012, Amit Sharma wrote:
 Thanks!
  
 The below is now working manually as well as via crontab.  is
 required so that log can be maintained. 
 #!/bin/bash
 # Script to check exim mailq at a specified interval
 date  /adminscripts/logs/eximcount
 Counter=`/usr/sbin/exim -bpc`
 echo $Counter  /adminscripts/logs/eximcount
 if [ $Counter -gt 0 ]
 then
 cat /adminscripts/logs/eximcount |mail -s Count of EXIM Mailq on
 Server  a.sha...@example.com else
 exit 1
 fi

So it seems that the problem was the exim executables being located in 
/sbin... that seems to be the major change between this version and the 
previous one.

CC'ing the ILUGD mailing list so that the archives reflect the solved 
state of the problem.

Regards,

-- Raj

 From: Raj Mathur (राज माथुर) r...@linux-delhi.org
 To: il...@frodo.hserus.net
 Sent: Monday, 27 February 2012 12:41 PM
 Subject: Re: [ilugd] Shell script not running as expected via
 crontab, runs fine manually !!
 
 On Monday 27 Feb 2012, Amit Sharma wrote:
  #!/bin/bash
  # Script to check exim mailq at a specified interval
  echo `date`  /adminscripts/logs/eximcount
  echo `exim -bpc`  /adminscripts/logs/eximcount
 
 First of all, why the needless complexity?  You can just:
 
 date  /adminscripts/logs/eximcount
 exim -bpc  /adminscripts/logs/eximcount
 
 Also, should the first  be a single  ?
 
  if [ `exim -bpc` -gt 0 ]
  then
  cat /adminscripts/logs/eximcount |mail -s Count of EXIM Mailq
  on Server  a.sha...@example.com else
  exit 1
  fi
 
  
 
  The above runs fine manually, however when I try to run it through
  crontab (as root), it DOES run but /adminscripts/logs/eximcount
  gets empty value. When I run it manually it is able to get the
  correct count like 5, 10 etc.
  What am I missing here? Please help.
 
 Check the permissions on the script.
 
 Remove the file before the cron runs and see if it gets created.
 
 Check where root's mail goes -- that will help you track any cron
 errors.
 
 Put full paths to all programs you execute in the script.
 
 Let us see the whole cron command line.
 
 Regards,
 
 -- Raj

-- 
Raj Mathur  || r...@kandalaya.org   || GPG:
http://otheronepercent.blogspot.com || http://kandalaya.org || CC68
It is the mind that moves   || http://schizoid.in   || D17F

___
Ilugd mailing list
Ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd


[ilugd] YouTube going crazy over copyrights

2012-02-27 Thread Smruti
Came across an article where even the natural sounds are being claimed as
copyright protected. To make matters worse, this Violation of Copyright
was automatically detected by YouTube.

http://c4sif.org/2012/02/youtube-identifies-birdsong-as-copyrighted-music/ *
*

-- 
I took the red pill.
___
Ilugd mailing list
Ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd