Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Orphaned Files 1

Status
Not open for further replies.

ManagerJay

IS-IT--Management
Jul 24, 2000
302
US
Is there a utility include with Apache which I can run on the web server, or remotely against the web server which will generate a list of files which are orphaned?

The ones I have found seem to deal mostly with finding broken links?

Thanks,



Jay
 
Hi

I suppose by orphaned file you mean a file present in the [tt]DocumentRoot[/tt] directory, but the other files have not links to it.

You can not do that remotely. If a file is not linked to the others an outsider can not reach it. You have to do that on the server machine.

As you did not specified your operating system, I suppose anything is Ok. This compares the list of files reached through the server and locally, and prints the differences.
Code:
wget -m -nd --delete-after -nv [green][i][URL unfurl="true"]http://example.com/[/URL][/i][/green] 2>&1 | sed '/URL:/!d;s/.*\/\///;s/ *\[[[:digit:]\/]*\] *//g;s/"//g;/\/->/s/-> *//;s/->.*//' | sort > needed.txt
find [green][i]/path/to/example/[/i][/green] -type f | sed 's,^[green][i]/path/to/[/i][/green],,' | sort > exists.txt
diff --line-format="%L" needed.txt exists.txt

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top