Hey Everyone,
This is my first post here so I hope I'm in the right spot. I need some help with a script. I don't have much experience in UNIX besides the basic command line stuff which I haven't used much so bear with me.
I've got a web application which acts as a document repository with an Oracle database and mostly pdf documents stored on the file system of a UNIX server. Each document is supposed to have a reference in the database with it's full path. Over the years people have been playing around in the file system and moving/deleting documents. We are running out of space and we need to do a massive clean up and re-org to get rid of orphaned documents.
I'm looking to write a script that will look at all the files in the file system and check against the database to see if there is a reference or not. If the file is not referenced in the database I'd like to list it in a file so we can analyze if the file should be deleted or moved back to it's proper place.
I have access to the file system via FTP and the DB with SQL Developer. I was thinking of writing a script to list all the files in the file system and then use that in SQL Developer somehow to search against the DB but I'm wondering it isn't possible to do it all in one big bang and not have to run two seperate scripts/processes.
Again, any help is more than welcome and thanks for taking the time to read this.
Thanks!