Sponsored Content
Top Forums Shell Programming and Scripting Nested loop not running using cronjob Post 302137707 by bihani4u on Wednesday 26th of September 2007 11:19:30 AM
Old 09-26-2007
Quote:
Originally Posted by Cam Young
Add the following at the start of your script:
#!/bin/ksh
. /etc/profile
. ${HOME}/.profile


Had a similar experience on HP-UX 11.2x some time ago.
If you still have an issue, add/remove other environment files that you may use.

HTH Smilie
thanks a lot man, It worked fine Smilie
i will sleep happily today
Smilie
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Cronjob is not running

hi, I have a shell script which has a sql plus code and unix if else condition. The file is located at root.I logged in as a root user and i have all permissions. I tried to set up a cron job so that the script need to run every minute.the script is running successfully without any problem. I... (2 Replies)
Discussion started by: sanei05
2 Replies

2. Shell Programming and Scripting

Running scripts through cronjob.

Hello everybody, I'm trying to run a shell script in crontab file. But anyhow it's not getting executed. Following is the command that I've used in crontab. 30 07 * * * . ./.cronprofile;/om/reports/reportscripts/jitu/prod/prd_pre_to_post.sh 35 11 * * * .... (3 Replies)
Discussion started by: jitu.jk
3 Replies

3. UNIX for Advanced & Expert Users

SYS CRONJOB just not running...

I'm trying to run "SAR -i 60" under #/var/spool/cron/crontabs/SYS 0,10,20,30,40,50 0-6 sh -c "/usr/lib/sa/sa1 60 10 &" 55 23 * 0-6 /usr/lib/sa/sa2 -i 900 -A machine is not running above cron job under "sys" at all. This suppose to run every minutes and all time in 24 hours. When day... (6 Replies)
Discussion started by: deal732
6 Replies

4. UNIX for Dummies Questions & Answers

how to cancel a cronjob if the cronjob still running

hi everyone I'm newbie in this forum hope I can get some help here :) I have a command in crontab that executed every 1 minute sometime this command need more than 1 minute to finish the problem is, the crontab execute this command although it's not finish processing yet and causing the system... (7 Replies)
Discussion started by: 2j4h
7 Replies

5. Shell Programming and Scripting

Cronjob not running

Hi, having problem running my cronjob, need the script to run every monday. And the error i'm getting is "No such file or directory", i've tried to change the env to /bin/bash and also /usr/bin/sh but both failed. Need help here. tq 0 0 * * 1 /bin/bash /home/omc/munir/raccli_rnc.sh Rgds... (3 Replies)
Discussion started by: adawiyah29
3 Replies

6. UNIX for Dummies Questions & Answers

Script not running through Cronjob

Hi, I have a .ksh script which updates the database. The script is running fine manually but it is not running through cron.All the file permissions are fine. The script contents are as below: #!/usr/bin/ksh ddate=`date +%Y%m%d` echo $ddate nohup sqlplus crm/crm @db_state_sync.sql >>... (3 Replies)
Discussion started by: shivangi
3 Replies

7. Shell Programming and Scripting

Nested if loop

Hi Team, I just want to check whether my nested if loop used is correct or not. if ] if ] export1 else export2 fi else if ] export3 else export4 fi fi Thanks Shiva (5 Replies)
Discussion started by: shivashankar_S
5 Replies

8. Shell Programming and Scripting

My Cronjob is not running

I created a script, size=`du -sm` size=`echo $size | sed 's/.$//'` size1='30720' if then { find /ask/tarballs -type f -name "*.tgz" -mtime +30 -exec ls -l {} \; find /ask/tarballs -type f -name "*.tgz" -mtime +30 -exec rm -f {} \; } else echo "Directory size doesnt exceed Threshold... (12 Replies)
Discussion started by: shaal89
12 Replies

9. UNIX for Beginners Questions & Answers

Cronjob not running on Ubuntu 14.04

I have created a test cronjob using crontab -e that runs a script at /home/cmccabe/cron.sh. I am not sure the script doesn't run though I can call it in terminal. Thank you :). crontab -e (run script sat at 6:10pm)? 10 18 * * 6 /home/cmccabe/cron.sh contents of cron.sh #!/bin/bash... (5 Replies)
Discussion started by: cmccabe
5 Replies
break(1)							   User Commands							  break(1)

NAME
break, continue - shell built-in functions to escape from or advance within a controlling while, for, foreach, or until loop SYNOPSIS
sh break [n] continue [n] csh break continue ksh *break [n] *continue [n] DESCRIPTION
sh The break utility exits from the enclosing for or while loop, if any. If n is specified, break n levels. The continue utility resumes the next iteration of the enclosing for or while loop. If n is specified, resume at the n-th enclosing loop. csh The break utility resumes execution after the end of the nearest enclosing foreach or while loop. The remaining commands on the current line are executed. This allows multilevel breaks to be written as a list of break commands, all on one line. The continue utility continues execution of the next iteration of the nearest enclosing while or foreach loop. ksh The break utility exits from the enclosed for, while, until, or select loop, if any. If n is specified, then break n levels. If n is greater than the number of enclosing loops, the outermost enclosing loop shall be exited. The continue utility resumes the next iteration of the enclosed for, while, until, or select loop. If n is specified then resume at the n- th enclosed loop. If n is greater than the number of enclosing loops, the outermost enclosing loop shall be used. On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words that follow a command preceded by ** that are in the format of a variable assignment are expanded with the same rules as a vari- able assignment. This means that tilde substitution is performed after the = sign, and also that word splitting and file name genera- tion are not performed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), exit(1), ksh(1), sh( 1), attributes(5) SunOS 5.10 17 Jul 2002 break(1)
All times are GMT -4. The time now is 06:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy