Hi guys,
I could use as much help on the logic of this, as some helpful code bytes.
I am currently collecting some state data and I save it in my web directory for public consumption every few seconds (when some data events occur).
I have been asked if, rather then serve the file up live, that I serve the file up late by 2 minutes. So I need to keep track of the log files somehow in terms of the order they were created, and then, after 2 minutes, start moving them into the web directory every second.
I was thinking two perl scripts. One creates my log file and copies it to a directory with a unique name (log_localtime.txt). Another perl script loads, waits the specified amount of minutes, and then moves the files (every x seconds) from oldest to newest from the log folder to my web folder.
For this to work, I need to be able to load the files into some perl array from oldest to newest. Any ideas?
After moving the oldest file into the web directory, I'll unlink it.
thanks
Tim
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.