Script not running properly when run from Crontab


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script not running properly when run from Crontab
# 1  
Old 05-03-2009
Script not running properly when run from Crontab

Hi

I am a novice Linux/Perl user and am struggling to overcome what I am sure is a simple problem.

I am using a perl program to create a shell script daily containing between 10 and 30 "at -f" commands for the same day. Then I change the file attributes to allow the file to be executed. When I run this script from the terminal it works fine and all the "at" commands are set up, however when I run it as a crontab event it only sets up the first 8 every time. Is there a simple explanation for this? If not, is there a way I can force the script to open and execute in a terminal session when invoked from crontab?

I am running the Hardy Heron version of Ubuntu.

Thanks for any help you can give me.

Simon
# 2  
Old 05-03-2009
welcome to unix.com

please use our FAQs and the search function before asking questions... with little effort you should find this:
https://www.unix.com/answers-frequent...n-crontab.html
if this doesn't help, please ask again.
# 3  
Old 05-03-2009
I don't know your version of Linux, but there is a maximum size to the cron job queue. In similar circumstances I staggered the at jobs with sleep statements.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script fails to run properly when run from CRONTAB

Hello all, I'm trying to write a script to gather and send data and it works just fine at the bash command line, but when executing from CRON, it does not run properly. My scripting skills are pretty limited and there's probably a better way, but as I said it works at the command line, but... (12 Replies)
Discussion started by: rusman
12 Replies

2. UNIX for Dummies Questions & Answers

crontab not running script

Hi All, I am having the below script to be run from crontab, it it doesnt run. 1 * * * * /home/cobr_ext/test.sh > /home/cobr_ext/temp.txt when i run i manally it runs without any issues. Could please help me as to why doesnt it run the script.:( (7 Replies)
Discussion started by: abhi_123
7 Replies

3. Shell Programming and Scripting

Script does not run properly

Hello everybody Im learning bash scrpting language and im making a script that read a file line by line and it does a comparison if in a line start with a letter or number and it will delete every ones that start with a letter. But im getting some errors First of all, this is the script's... (5 Replies)
Discussion started by: alienrunes
5 Replies

4. UNIX for Advanced & Expert Users

Particular script not running through crontab

Hi, I have created the below script, set -x # Set the Path of Environment file ENV_FILE_DIR=/opt/app/p1trp1c1/sybase/ecdwqdm/xrbid/QDM_Prod/bin LOG_DIR=/opt/app/p1trp1c1/sybase/ecdwqdm/xrbid/QDM_Prod/log export ENV_FILE_DIR export LOG_DIR # Set Audit Environment . ${ENV_FILE_DIR}/QDM.env... (8 Replies)
Discussion started by: yohasini
8 Replies

5. Shell Programming and Scripting

Crontab not running a script

Hi, I posted this in the Solaris forum but I think this one would be more appropriate. I created a script starting with the following lines: #!/usr/bin/ksh flag=n export flag typeset -i quant=0 (...) When running it I'm getting the following 2 errors: /tmp/tstscript/testfail.ksh:... (9 Replies)
Discussion started by: Cvg
9 Replies

6. Shell Programming and Scripting

run script through crontab using ksh

hi i have a script called test.sh. the content is ls >> crontest.txt. if i run manually it's giving output.but if i scheduled in crontab it's not giving output. crontab entry: 02 * * * * /sms5/SMSHOME/eds_sh/test.sh >> /sms5/SMSHOME/eds_sh/testfile/logfile 2>&1 I am using ksh.is there... (2 Replies)
Discussion started by: muraliinfy04
2 Replies

7. Shell Programming and Scripting

A script doesnt work properly when crontab

Hi, I have a script which does a tar and sends it to another server as backup. Script is as below # Locations to be backed up. Seperate by space BACKUP_LOCATIONS=/repos/subversion BACKUP_BASE_FOLDER=/bakpool BACKUP_FILE_NAME_ROOT=svn-backup START_TIME_DISP=`date` START_TIME=`date... (11 Replies)
Discussion started by: digitalrg
11 Replies

8. Shell Programming and Scripting

How do i run a shell script without crontab.

Hi Folks, Could you please suggest me how to run a shell script on a solaris env without using crontab. I am actually trying to write a shell script which will grep "WORD" in the logfile andd sends a email.Thanks in advance. Thanks Sandeep. (3 Replies)
Discussion started by: sandeep anand
3 Replies

9. UNIX for Dummies Questions & Answers

Script not running properly

I created a script before which was this :- cd /mike/dataxfer for dir in *; do if ; then ssh -l abc nissan "mkdir -p /mike/web/$dir" scp -r ${dir}/priceops nissan:mike/web/${dir}/ fi done exit 0 This script worked fine for me with no problem. It will... (5 Replies)
Discussion started by: chris1234
5 Replies

10. Shell Programming and Scripting

recurring run of sh script in crontab

Hello gurus. I have a problem: my crontab -e is looks like this: ORACLE_SID=bla-bla * 21 * * * (sqlplus hotback/hotback @/oracle/backups/bla-bla/scripts/hotback/daily_hotback.sql) 0 19 * * * /oracle/backups/dev10g/scripts/exports/daily_exports.sh 0 1 * * *... (4 Replies)
Discussion started by: MarGur
4 Replies
Login or Register to Ask a Question