Hi David,

If you can do some UV basic coding or have access to a resource who can then:
Have a look at installing a file trigger on the file(s) you need to monitor.
The "sysdesc" manual contains trigger information.
The reason I suggest this is that the trigger will fire on your designated 
condition (INSERT/UPDATE etc) which in turn can cause other events so is more 
efficient than running a query on the file every n seconds/minutes.

Alternatively, seeing as you're probably running on a unix host (/var was the 
giveaway) then a poor man's version of a trigger might entail a shell script 
that does an `ls -lt /path/FILE.NAME` and check the last mod time of the file. 
This would give you a fair idea as to when it was last modified and can then 
launch into UV for your csv creation routine..?

If the UV FILE.NAME is a directory (which it may or may not be) then you could 
simply `ls -lrt | tail -1` periodically in a cron job to derive the last 
updated record.

Regards,
Peter



Peter Cheney
Ultracs Developer
t 07 3017 8837 | f 07 3002 8400
e peter.che...@firstmac.com.au
w firstmac.com.au


-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David Campbell
Sent: Wednesday, 11 December 2013 15:39
To: u2-users@listserver.u2ug.org
Subject: [U2] Exporting to File regularly

Hi Everyone,

I'm new to universe (a complete noob) and I couldn't quite find what I was 
looking for on google and I've been smashing my face against this for a while 
until I stumbled upon this mailing list so I was wondering if anyone could help 
me out here.

I'm writing a script that will hopefully alert me via email whenever a new 
record is added to a particular universe file, if there is a better way to do 
this I would be all ears. I'm working around another proprietary system which 
operates on universe and I dont know enough about universe to really say for 
sure what is proprietary and what is universe standard code and the proprietary 
stuff is covered in NDA's and no touchy hand slappy orders so I cannot really 
modify the way it works, I just need to know when a new entry appears, 
preferably via an smtp email.

My Current plan works like this

I'm looking to regularly (every 5 minutes) output data into a text or csv file, 
doesn't matter really, so long as it is not full of characters that batch 
scripts hate and it can happen in an automated fashion.

The closest thing I can get to what I want right now is

SP.ASSIGN HS
LIST FILE.NAME LPTR

this lists all the records and dumps them in a spool file under /var/spool/uv/ 
and then a script I have written in the past retrieves that spool file for me, 
I have trained that spool file to look for specific markers in the first line 
of the file and apply a particular script to it

This spooled print job gives me a list of the records that I can then sort 
numerically, pick the highest number, check that number against what the number 
was last time and alert me via email if its different.

Ultimately I would love for a regularly running script to just output the 
highest record (maybe sort numerically and give me the highest number and dump 
just that number into a file on the unix box for me to retrieve and the work 
with.

Any help would be greatly appreciated!




--
View this message in context: 
http://u2-universe-unidata.1073795.n5.nabble.com/Exporting-to-File-regularly-tp42264.html
Sent from the U2 - Users mailing list archive at Nabble.com.
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

 -------------------------------------------------------------------------------
Note: 
This email (inc all attachments) is for the use of the intended recipient(s) 
only.
Privileged or confidential information may be contained in this communication. 
If you have received this email in error, please notify the sender immediately 
and then delete all copies of this message from your computer network. If you 
are not the intended recipient, you must not keep, use, disclose, copy or 
distribute this email without the author's prior permission. If you are the 
intended recipient and you do not wish to receive similar electronic messages 
from us in future, then please respond to the sender to this effect. 
We have taken precautions to minimise the risk of transmitting software 
viruses, but advise you to carry out your own virus checks on this email and 
its attachments. We do not accept liability for any loss or damage caused by 
software viruses and do not represent that this transmission is free from 
viruses or other defects. 
Firstmac Limited (ABN 59 094 145 963) (AFSL 290600) 
 -------------------------------------------------------------------------------
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to