Command line check for corrupted files

Alloy Network Inventory is a comprehensive, budget-friendly, easy-to-deploy network inventory solution that provides you with accurate and up-to-date information from every computer on your network.
 

Command line check for corrupted files

Postby RabidDawg on Mon Apr 17, 2006 9:56 pm

I have an automated process setup to prune, export to SQL and html, however if the xml export comes across a corrupted audit file it blows up the process. Is there any way to check for corrupted files and delete them without having to run the GUI? I have to open the GUI on a daily basis to clean out the corrupted files to make sure my scripts will run, a time consuming process I'd like to do without.

Thanks,

Brian
RabidDawg
Senior
 
Posts: 52
Joined: Mon Nov 10, 2003 2:16 pm

Postby RabidDawg on Mon Nov 27, 2006 10:59 pm

Originally posted by RabidDawg
I have an automated process setup to prune, export to SQL and html, however if the xml export comes across a corrupted audit file it blows up the process. Is there any way to check for corrupted files and delete them without having to run the GUI? I have to open the GUI on a daily basis to clean out the corrupted files to make sure my scripts will run, a time consuming process I'd like to do without.

Thanks,

Brian

This is getting old. I have to run the GUI on a daily basis to clear out the corrupted files. Any help would be MUCH appreciated.
RabidDawg
Senior
 
Posts: 52
Joined: Mon Nov 10, 2003 2:16 pm

Postby RabidDawg on Wed Dec 06, 2006 4:30 pm

Well after pondering this problem, a solution finally came to me while I was shaving one morning. Isn't it funny how stuff comes to you at the oddest times?

Hopefully this will help somebody else.

Here is what I'm doing:
I'm using vbscript
I copy the adt file to a temp directory, run adt2xml, look at the output, if index out of bounds or Stream read error is part of the output then I move the adt file from the repository to a directory for the corrupted files, if the file is ok, I copy the xml file to a directory for processing later, delete the remaining files in the temp directory and move on to the next adt file in the repository. What adt2xml doesn't pick up as an error are files that are 0 bytes, I look at file size first and move them over to the corrupted directory.

Hopefully this will end my grief dealing with corrupted files.
RabidDawg
Senior
 
Posts: 52
Joined: Mon Nov 10, 2003 2:16 pm


Return to Alloy Network Inventory 4

Who is online

Users browsing this forum: No registered users and 1 guest

cron