LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 08-12-2008, 09:23 AM   #1
dningale
LQ Newbie
 
Registered: Aug 2008
Posts: 25

Rep: Reputation: 15
script expression not running in cronjob


hi,


ex. ctot=`expr $ctota + $zar`

echo $ctot

when I puts this in script and fired manually gives output but not when executed as a cronjob.

Last edited by dningale; 08-12-2008 at 09:28 AM.
 
Old 08-12-2008, 09:50 AM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by dningale View Post
hi,


ex. ctot=`expr $ctota + $zar`

echo $ctot

when I puts this in script and fired manually gives output but not when executed as a cronjob.
A cron job will not print the output on the screen. You have to redirect the output to a file.
 
Old 08-13-2008, 12:04 AM   #3
dningale
LQ Newbie
 
Registered: Aug 2008
Posts: 25

Original Poster
Rep: Reputation: 15
Actually

when I schedules this in cronjob as it should mail the value of variable it does not give any value.

However it mails the value when fired manually.

ex.

tot=890

echo $tot |mailx -s total mailid@domain.com

will mail, blank when added to script and scheduled to cronjob.

Last edited by dningale; 08-13-2008 at 12:39 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cronjob --> my script to scp to remote server bskrakes Linux - General 5 07-04-2007 04:25 PM
sftp script via cronjob ?? OzTEXS Linux - Security 21 12-28-2006 03:38 PM
Cronjob / script question nazs Linux - General 1 12-21-2006 01:45 PM
cronjob php script MrSako Linux - General 1 08-27-2006 07:30 PM
cronjob not working but script works dtra Linux - Newbie 4 02-28-2005 05:05 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 02:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration