this finds all xml files created in the last 2 minutes and orders them by time. The problem is that our unix system does not set the milliseconds for the file creation timestamp, so the ordering of files is done at the seconds scope, but i need the milliseconds in order to list the files in the correct order, because many are created at the same second.
I would need a command like "tail" that outputs the file names the moment they are created. either a command or a script would be great.
if any clarification is required please let me know.
thanks.
That is fine for the situation i was needing this for.
I have a service call that generates multiple log files, many created at the same second. Since the milliseconds are not used on the system, i couldnt order it with that. The inode works for this situation, but i guess you are right that it will not work if there are files being deleted on the system elsewhere. For my situation though, i run the service, list the files, so there is almost no chance that other files have been deleted since.
If all these files are being dropped into a single directory, how often do you delete and recreate the directory itself? There must be some file naming convention used to prevent duplicates, can it not be used in such way that listing by file name will also be chronological?
That's a fair enough approach of ordering files based on the filename. But that won't be case always. If there are 2 different systems without any protocol for filenaming/log filenaming convention, then this won't be always followed.
An example could be : a system that takes care of log files alone cannot request/demand other systems to create filenames in specific format.
My assumption was that in the original post, the term log was used to mean a transaction, and that each file contains a single transaction, in which case all sources of data have to follow the same file name convention, rather than a typical log file that has transactions appended to it.
Another concept might be to email the file, and have the email piped to a process. This would guarantee a first in first out sequence, based on the time the file was received, however, it might not mean first sent, first processed.