Need get data from XML file through shell script..


Login or Register to Reply

 
Thread Tools Search this Thread
# 15  
Quote:
Originally Posted by RudiC
man paste:


HOW did you resolve the issue?
Hi Rudi, i have made your code in shell script as below

daslog.sh
Code:
grep -E "<(timestamp|severity|message)" das.xml | paste -sd"\t\t\n" | grep -E "ERROR" | tr '\t' '\n' >> dasoutput.log

and set up cronjob like
Code:
 * * * * * /local/flamingo/log/das/daslog.sh >> /local/flamingo/log/das/output.log >> /local/flamingo/log/das/output.log

here the problem is if i run shell script manually it is updating dasoutput.log but through cronjob its not updating dasoutput.log.

can you help me on this.

--- Post updated at 07:28 AM ---

hi all,
i have made below code in shell script as below

daslog.sh
grep -E "<(timestamp|severity|message)" das.xml | paste -sd"\t\t\n" | grep -E "ERROR" | tr '\t' '\n' >> dasoutput.log

and set up cronjob like
* * * * * /local/flamingo/log/das/daslog.sh >> /local/flamingo/log/das/output.log >> /local/flamingo/log/das/output.log

here the problem is if i run shell script manually it is updating dasoutput.log but through cronjob its not updating dasoutput.log.

can any one help me on this.
# 16  
That cron job looks suspect. Do you really want it to trun every minute? Do you really need to redirect stdout twice? Do you receive an error mail?


And, the redirection in daslog.sh will override the redirection in crontab. Look for dasoutput.log in the user's home directory.
This User Gave Thanks to RudiC For This Post:
# 17  
Quote:
Originally Posted by RudiC
That cron job looks suspect. Do you really want it to trun every minute? Do you really need to redirect stdout twice? Do you receive an error mail?


And, the redirection in daslog.sh will override the redirection in crontab. Look for dasoutput.log in the user's home directory.
no for testing , i made it for every minute and i tried with

* * * * * /local/flamingo/log/das/daslog.sh > /local/flamingo/log/das/output.log >> /local/flamingo/log/das/output.log this way also but not working.
# 18  
Please answer ALL questions.
This User Gave Thanks to RudiC For This Post:
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
How to Parse the XML data along with the URL in Shell Script?
Megala
Hi, Can anybody help to solve this. I want to parse some xmldata along with the URL in the Shell. I'm calling the URL via the curl command Given below is my shell script file export...... Shell Programming and Scripting
7
Shell Programming and Scripting
Convert XML to Data File in Shell Script
ragha81
Hi All, I will be getting a huge XML file with a lot of records in it. I need to convert it into multiple data files. SAMPLE XML FILE <ABSProductCatalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <ProductSalesHierachy> - <Portfolios> - <Portfolio productCode="P1"> ...... Shell Programming and Scripting
8
Shell Programming and Scripting
How to remove xml namespace from xml file using shell script?
Gary1978
I have an xml file: <AutoData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Table1> <Data1 10 </Data1> <Data2 20 </Data2> <Data3 40 </Data3> <Table1> </AutoData> and I have to remove the portion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" only. I tried using sed...... Shell Programming and Scripting
10
Shell Programming and Scripting
Help with shell script to extract data from XML file
yajaykumar
Hello Scripting Gurus, I need help with extracting data from the XML file using shell script. The data is in a large XML and I need to extract the id values of all completedworkflows. Here is a sample of it. Input and output data is also in the attached text files. <wfregistry>...... Shell Programming and Scripting
5
Shell Programming and Scripting
extract data from xml- shell script using awk
nishana
Hi, This is the xml file that i have. - <front-servlet platform="WAS4.0" request-retriever="SiteMinder-aware" configuration-rescan-interval="60000"> <concurrency-throttle maximum-concurrency="50" redirect-page="/jsp/defaulterror.jsp" /> - <loggers> <instrumentation...... Shell Programming and Scripting
5
Shell Programming and Scripting