Clean unused sound with big number of files¶
Problem: when folders with audio and text materials contains big number of files (>100 000)
- application can’t read whole content of this folder
- server stops to serve other clients when somebody tries to read content
As result, DJin.exe can’t clean unused material.
This topic contains instruction how to resolve this situation and clean unused files to reduce it’s count.
Warning! This is kind of trick, use a special DJin workplace to do it and do only described steps on it.
Read the folders content¶
There is simple application [raw-CountFiles.exe CountFiles], that read content of one folder, without subfolders, and stores file list with information as text file.
Run this directly on the host, that controls file storage with files.
Read content of folder, that DJin use to store (and clean) files (see Global settings AudioStorage and DB Storage tabs to determine path to these folders).
Do the following: Copy [raw-CountFiles.exe] directly to host, that controls file storage. Specify local path to DJin storage folder (not UNC network name), as in example
src=d:\ROOT\storage\news\*.* dst=d:\content_of_sorage_news.txt Q=1000 T=1000
- SRC - path to folder with big number of file to read
- DST - name of text file to store result
- Q - number of sequentially enumerated files
- T - timeout between file groups to give server a rest (milliseconds)
Program will print statistics every Q files.
Program should ends without text FAIL on screen. If program fails - found a reason and run program again.
Repeat it for every folder with big number of files, use different result files for each folder. If it will be to hard for servers - set less Q.
So, now you has read content all storage folders an keep it in set of text files.
Run cleaning¶
Note. All text files, described here, are in ANSI encoding, not unicode
- Choice a DJin workplace, that will be used to clean material. It should be configured as normal workplace in your system (Root and DB connection should be set and accessible).
- Shutdown DJin.
- Create folder with name $FILES in same folder with DJin.exe
D:\DJIN_FOLDER\$FILES
- Create file with name $ in this folder
D:\DJIN_FOLDER\$FILES\$
- Create its content as the following:
d:\content_of_sorage_news.txt=\SERVER\ROOT\storage\news
d:\content_of_sorage_music.txt=\SERVER\ROOT\storage\music
... and all other folders...
- Run DJin.exe and clean unused material
- You must get error messages (red lamp will flash), started with "File content found" (and information from line of $ file). It’s not a error, it’s a sign that $ file is read.
You must get one message for one line of file $. You can control it in debug log. - Clean material as usual. Be carefull, as usual.
- You must get error messages (red lamp will flash), started with "File content found" (and information from line of $ file). It’s not a error, it’s a sign that $ file is read.
- Shutdown DJin.exe
- Delete folder $FILES