2024-05-09 15:29:45 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
#set -x
|
|
|
|
|
|
2024-05-10 14:20:39 -05:00
|
|
|
systemd-cat -t "`basename $0`" -p info <<< "Started"
|
2024-05-09 15:29:45 -05:00
|
|
|
|
|
|
|
|
./getNewAccessToken.sh
|
2024-05-27 12:10:08 -05:00
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
|
|
systemd-cat -t "`basename $0`" -p err <<< "Child process to get access token reported error. Exiting."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2024-05-09 15:29:45 -05:00
|
|
|
|
|
|
|
|
jq -r '.[].Symbol' allSymbols.json | sort | while read theSymbol; do
|
|
|
|
|
# I am not interested in detail quotes at the moment
|
|
|
|
|
#./recordQuoteSingleSymbolSingleRun.sh ${theSymbol}
|
|
|
|
|
#if [[ $? -ne 0 ]]; then
|
|
|
|
|
# touch temp/hadErrors.$$.tmp
|
|
|
|
|
#fi
|
|
|
|
|
|
|
|
|
|
if [[ '$XSP' = ${theSymbol} ]]; then
|
2024-08-12 15:05:11 -05:00
|
|
|
./recordOptionChainSingleSymbolSingleRun.sh ${theSymbol} toDate $(date "+%Y-%m-%d" -d "+400 days")
|
2024-05-09 15:29:45 -05:00
|
|
|
if [[ $? -ne 0 ]]; then
|
2024-06-20 09:34:11 -05:00
|
|
|
systemd-cat -t "`basename $0`" -p warning <<< "falling back to stitching for ${theSymbol}"
|
2024-07-17 14:08:55 -05:00
|
|
|
./recordOptionChainSingleSymbolSpecialRun.sh ${theSymbol} toDate $(date "+%Y-%m-%d" -d "+400 days")
|
2024-06-20 09:34:11 -05:00
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
|
|
touch temp/hadErrors.$$.tmp
|
|
|
|
|
fi
|
2024-05-09 15:29:45 -05:00
|
|
|
fi
|
2024-05-30 10:53:17 -05:00
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
fi
|
|
|
|
|
|
2024-05-17 15:17:09 -05:00
|
|
|
if [[ '$SPX' = ${theSymbol} ]]; then
|
2024-07-17 14:08:55 -05:00
|
|
|
./recordOptionChainSingleSymbolSingleRun.sh ${theSymbol} fromDate $(date "+%Y-%m-%d" -d "+40 days") toDate $(date "+%Y-%m-%d" -d "+46 days")
|
2024-05-17 15:17:09 -05:00
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
|
|
touch temp/hadErrors.$$.tmp
|
|
|
|
|
fi
|
|
|
|
|
continue
|
|
|
|
|
fi
|
|
|
|
|
|
2024-08-09 08:46:53 -05:00
|
|
|
#Default behavior - fall back to stitching on error
|
|
|
|
|
./recordOptionChainSingleSymbolSingleRun.sh ${theSymbol}
|
2024-05-17 15:17:09 -05:00
|
|
|
if [[ $? -ne 0 ]]; then
|
2024-08-09 08:46:53 -05:00
|
|
|
systemd-cat -t "`basename $0`" -p warning <<< "falling back to stitching for ${theSymbol}"
|
|
|
|
|
./recordOptionChainSingleSymbolSpecialRun.sh ${theSymbol}
|
|
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
|
|
touch temp/hadErrors.$$.tmp
|
|
|
|
|
fi
|
2024-05-09 15:29:45 -05:00
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
if [[ -e temp/hadErrors.$$.tmp ]]; then
|
|
|
|
|
rm temp/hadErrors.$$.tmp
|
|
|
|
|
curl -d "" -X POST "https://deadswitch.kawomi.com/api/v1?topic=trade.schwab.error.recordAllSymbolsSingleRun&secs=1&email=joe@kawomi.com"
|
|
|
|
|
fi
|
|
|
|
|
|
2024-05-10 14:20:39 -05:00
|
|
|
systemd-cat -t "`basename $0`" -p info <<< "Finished"
|