Sponsored Content
Top Forums Shell Programming and Scripting Script runs in command-line fine but times out in CRON? Post 302815353 by phpchick on Friday 31st of May 2013 02:40:03 PM
Old 05-31-2013
Sorry, here it is, relatively simple.
Is the bashshebang comment relevant even though the script successfully starts? - At the moment I have no bashshebang in my script but, didn't think this was an issue since it still runs.



Code:
../stocks/aaa-stockuniverse.txt

stock="soda"

eval $(curl -s "http://www.web.com/ig/api?stock=$stock"|sed 's/</\n</g' |sed '/data=/!d; s/ data=/=/g; s/\/>/; /g; s/</GF_/g' |tee ~/stocks/$stock.txt)




while read line
do
    array+=("$line")
done < "/home5/username/stocks/aaa-stockuniverse.txt"

for ((i=0; i < ${#array[*]}; i++))
do
	eval $(curl -s "http://www.web.com/ig/api?stock=${array[i]}"|sed 's/</\n</g' |sed '/data=/!d; s/ data=/=/g; s/\/>/; /g; s/</GF_/g' |tee /home5/username/public_html/dailyquotes/${array[i]}.txt)
	echo "${array[i]},$(date +%Y-%m-%d),$GF_open,$GF_high,$GF_low,$GF_last,$GF_volume"
	sleep $[ ( $RANDOM % 10 )  + 1 ]s
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script runs fine on UNIX Server...Not through MSK Tool kit on Windows Server

I have a .sh script which was running fine on all the UNIX Servers (AIX, SunSolaris). The script requires two mandatory parameters and many optional parameters. Now at a different client place who are on a Windows Server, when I try to execute the script through MKS Toolkit, there are couple of... (5 Replies)
Discussion started by: madhunk
5 Replies

2. Shell Programming and Scripting

Cron job fails, but works fine from command line

I have a very basic script that essentially sends a log file, via FTP, to a backup server. My cron entry to run this every night is: 55 23 * * * /usr/bin/archive_logs The script runs perfectly when executed manually, and actually worked via cron for about three weeks. However, it mysteriously... (3 Replies)
Discussion started by: cdunavent
3 Replies

3. Shell Programming and Scripting

Script runs fine, but not in a cron

Okay, I have the following script that runs fine from a command line as well as an executable .sh file. It just moves any file/folder with movie* in the name to a folder called _Movies. The issue I'm running into is when it's call from a cron. find /mnt/HD_a2/BT/complete -iname "movie.*" -exec... (4 Replies)
Discussion started by: sammyk
4 Replies

4. Shell Programming and Scripting

Script Runs fine but not giving any output

Hi, My script is running with no erros but not giving any output can anyonehelp. #!/bin/ksh . /home/application/bin/application.env OUTFILE=Result.txt PROD_PASSWORD=`${GET_PWD} -f ${PWD_FILE_PATH} -s ${PROD_SERVER} -u ${PROD_USER}` echo "1)To get the book last loaded details " read... (7 Replies)
Discussion started by: jagadish_gaddam
7 Replies

5. Shell Programming and Scripting

awk command in script gives error while same awk command at prompt runs fine: Why?

Hello all, Here is what my bash script does: sums number columns, saves the tot in new column, outputs if tot >= threshold val: > cat getnon0file.sh #!/bin/bash this="getnon0file.sh" USAGE=$this" InFile="xyz.38" Min="0.05" # awk '{sum=0; for(n=2; n<=NF; n++){sum+=$n};... (4 Replies)
Discussion started by: catalys
4 Replies

6. Shell Programming and Scripting

Shell script runs fine in Solaris, in Linux hangs at wait command

HI, I have a strange problem. A shell script that runs fine on solaris. when i ported to linux, it started hanging. here is the core of the script CFG_FILE=tab25.cfg sort -t "!" -k 2 ${CFG_FILE} | egrep -v "^#|^$" | while IFS="!" read a b c do #echo "jobs output" #jobs #echo "jobs... (13 Replies)
Discussion started by: aksaravanan
13 Replies

7. Shell Programming and Scripting

CRON shell script only runs correctly on command line

Hi, I'm new to these forums, and I'm hoping that someone can solve this problem... To make things short: I have DD-wrt set up on a router. I'm trying to run a script in CRON that fetches the daily password from my database using SSH. CRON is set like so(in web interface): * * * *... (4 Replies)
Discussion started by: louieaw
4 Replies

8. Shell Programming and Scripting

Script runs fine manually but not in crontab

Hello Guys, I have scratched my head alot on this but couldn't find clue what's wrong. Can you please help me with this? My problem is as following. 1) When I manually execute following script it runs successfully with below output. bash-3.00# more smssend #!/bin/bash echo -e "<Request... (16 Replies)
Discussion started by: umarsatti
16 Replies

9. Shell Programming and Scripting

Part of the Shell script is not running via crontab, runs fine manually

Hello Team, As a part of my job we have made a script to automate a service to restart frequently. Script having two functions when executing it's should find the existing service and kill it, then start the same service . Verified the script it's working fine when executing... (18 Replies)
Discussion started by: gowthamakanthan
18 Replies

10. AIX

Script runs in shell but not cron

We run some menu driven software that has the ability to batch menu paths and generate reports quickly. Normally you run a batch like: $ BATCH BATCHNAME The batch program then prompts you for the date you want the report run for. I got some help from some folks on IRC to do the following: BATCH... (2 Replies)
Discussion started by: herot
2 Replies
Finance::Quote::BMONesbittBurns(3)			User Contributed Perl Documentation			Finance::Quote::BMONesbittBurns(3)

NAME
Finance::Quote::BMONesbittBurns Obtain quotes from the BMO NesbittBurns site SYNOPSIS
use Finance::Quote; $q = Finance::Quote->new; %info = Finance::Quote->fetch("bmonesbittburns","NT,X"); DESCRIPTION
This module fetches information from the "BMO NesbittBurns Quitre Qote" site. Most Canadiam and US stocks as well as Canadian Mutual Funds are available. The symbolm representing a stock or mutual fund is composed of the stock symbol, a comma, and then the index or type. The following indexes and types are supported: T Toronto Stock Exchange MF Canadian Mutaul Fund V Canadian venture Exchange I Index X U.S Stocks (most exchanges) This module is loaded by default on a Finance::Quote object. It's also possible to load it explicity by placing "BMONesbittBurns" in the argument list to Finance::Quote->new(). Information obtained by this module may be covered by BMO Nesbitt Burns terms and conditions. See http://bmonesbittburns.com/ for details. LABELS RETURNED
The following labels may be returned by Finance::Quote::BMONesbittBurns : name, last, date, p_change, bid, offer, open, high, low, volume, currency, method, exchange, time, date. SEE ALSO
BMO Nesbitt-Burns http://bmonesbittburns.com/QuickQuote/QuickQuote.asp perl v5.12.1 2009-10-05 Finance::Quote::BMONesbittBurns(3)
All times are GMT -4. The time now is 09:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy