Sponsored Content
Full Discussion: running sql in crontab
Top Forums UNIX for Dummies Questions & Answers running sql in crontab Post 26675 by dorilevy on Thursday 22nd of August 2002 06:14:33 AM
Old 08-22-2002
the script -

Code:
#!/bin/csh 
set c_str = "rating_info/rating@bscsprod"
set file=`ls -lrt /var/tmp/Rep4* | tail -1 | awk '{print$9}'`
set workfile="/tmp/Rep4.txt"
set temp="'"
set ttt="\.\." 
cat $file | sed 's/'$temp'/./g' > /tmp/a.txt
cat /tmp/a.txt | sed 's/'$ttt'/-/g' > /tmp/b.txt
cat /tmp/b.txt | sed 's/'\,'/\  /g' > $workfile
rm /tmp/a.txt
rm /tmp/b.txt
foreach stam ("00-04" "04-08" "08-12" "12-16" "16-20" "20-24" "> 25" )
 cat $workfile | grep "$stam" | cut -f2-6 > /tmp/sss.txt
 set s_str=""
 foreach num ( `more /tmp/sss.txt` )
   if ( `echo $num | cut -c1 ` == "." ) then
    set s_num="0$num"
   else
    set s_num="$num"
   endif
   set s_str="$s_str $s_num"
 end
 sqlplus $c_str @/bill/app01/bscsprod/scripts/dori/update_delay.sql `echo $s_str` "'$stam'"
 rm /tmp/sss.txt
end
set delay=`cat $workfile | grep "Delay" | cut -f2`
sqlplus $c_str @/bill/app01/bscsprod/scripts/dori/update_unpr.sql "$delay" 'delay'
set udate=`head -1 $workfile`
sqlplus $c_str @/bill/app01/bscsprod/scripts/dori/update_time.sql "'$udate'" 'update'

added code tags for readability --oombera

Last edited by oombera; 02-18-2004 at 06:45 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

SQL vs Crontab

I've been trying to execute a script which call some SQL Queries for midnight report, using crontab I got the next mesage: Message file sp1<lang>.msb not found Error 6 initializing SQL*Plus Message file sp1<lang>.msb not found Error 6 initializing SQL*Plus If I use the "at" command it... (4 Replies)
Discussion started by: alex blanco
4 Replies

2. UNIX for Dummies Questions & Answers

running .sh, .sql .etc how to?

hi all yes, I am a beginner in Unix,-sun solorais--V8... what is the command to run files.... single and batch jobs....any help would be great... Cheers ps...i know running files in Sqlplus on Unix prompt, I can use the @' sign...but how does this work.. Cheers E (2 Replies)
Discussion started by: etravels
2 Replies

3. Shell Programming and Scripting

crontab and shell script that executes a sql.

Problem: I have a crontab and when it kicks off, xxx.sh shell script is called. Which has a nohup sqlplus session call. Problem is sql does not get executed and a text file is not getting created. Only a empty log file is getting created. Are there any constraints for crontab to open a sql... (6 Replies)
Discussion started by: radhika
6 Replies

4. Shell Programming and Scripting

Access SQL with crontab

Hi, I wrote a script shell whose function is to make a remove of directories depending on the result of a query on Oracle database. When I execute my script shell directly from unix, it works fine. But, when I put it in a line of a crontab, it doesn't work no more, because of the sql... (1 Reply)
Discussion started by: tbeghain
1 Replies

5. UNIX for Advanced & Expert Users

Crontab is not running!!!

Hi experts, need your helpo. after editing the crontab while saving the file it says- "/tmp/crontabRlaauT" 1 line, 77 characters cron may not be running - call your system administrator And i checked after certain time. script in cron is not running. I got a mail in user saying... (1 Reply)
Discussion started by: thepurple
1 Replies

6. UNIX for Dummies Questions & Answers

Issue while running from crontab

Hi All, Here is my command which I've scheduled to be run from crontab, but it's giving error message: rah: rahhost executable needed but not in PATH My cmd is- 36 10 * * * /opt/IBM/dwe/db2/V9.5/bin/rah "df -m" >> /db2home/bculinux/Files/log/db.out 2>&1 Though I've added path... (5 Replies)
Discussion started by: NARESH1302
5 Replies

7. UNIX for Dummies Questions & Answers

Crontab + Script + .sql

Hi guys today i'll bring to you a new problem that i need to execute. So what i need to do it's create a script that: conect to some database logon run a .sql script logoff and close the connection after that, put this script on the crontab To set up the crontab it's ok for me, i think... (3 Replies)
Discussion started by: Newer
3 Replies

8. 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

9. Solaris

Crontab is not loading/running

hi, i have crontab where i have put my db backup scripts but crontab do not run at specific time. i have checkted the scripts andwhen run the script as ./mydbbkp.sh so it successfully run and do the job but from cron it is not running whihcmeans cron is not running. i have an oracle user under... (3 Replies)
Discussion started by: janakors
3 Replies

10. Shell Programming and Scripting

Storing multiple sql queries output into variable by running sql command only once

Hi All, I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise. Eg : Select 'Query 1 output' from dual; Select 'Query 2 output' from dual; I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies
COILS-WRAP(1)							   User Commands						     COILS-WRAP(1)

NAME
coils-wrap - runs ncoils three times to give you a three-window output SYNOPSIS
coils-wrap [OPTION] DESCRIPTION
coils-wrap runs ncoils three times to give you a three-window output. ncoils is a program that compares a sequence to a database of known parallel two-stranded coiled-coils and derives a similarity score. By comparing this score to the distribution of scores in globular and coiled-coil proteins, the program then calculates the probability that the sequence will adopt a coiled-coil conformation. OPTIONS
-i input file in FASTA format -o output file -r raw output file, default: `<output file>_raw' -m matrix type; set matrix (MTK or MTIDK) -w weight a&d = b,c,e,f&g (boolean) EXAMPLES
"coils-wrap -m MTIDK -i /usr/share/doc/ncoils/1srya.fa -o /tmp/coils.out -r /tmp/coils_raw.txt && less /tmp/coils.out /tmp/coils_raw.txt" "ncoils -win 14 < /usr/share/doc/ncoils/1srya.fa" FILES
/usr/share/coiledcoils/*.mat matrix data files AUTHOR
R.B. Russell, A.N. Lupas, 1999 COPYRIGHT AND LICENSE
GPL Based on Lupas, Van Dyck & Stock (1991) Science 252,1162-1164 SEE ALSO
ncoils(1), "usr/share/doc/coils/README", http://www.russelllab.org/cgi-bin/coils/coils-svr.pl <http://www.russelllab.org/cgi- bin/coils/coils-svr.pl> A Lupas: Prediction and Analysis of Coiled-Coil Structures. Methods in Enzymology, 266, 513-525, 1996 A. Lupas, M. Van Dyke, and J. Stock: Predicting coiled coils from protein sequences. Science, 252, 1162-1164, 1991 2002 2011-10-29 COILS-WRAP(1)
All times are GMT -4. The time now is 07:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy