Monitoring and Checking the Download Area[NEEDS REFS]

Monitoring and Checking the Download Area
One of the many ways of adding multiple directories and files to create Categories and Downloads automatically is to use the 'Check Downloads' feature.

This assumes that you have uploaded the directories and files into the jDownloads 'region' whose default root directory is called 'jdownloads' and is located in the joomla root directory: <joomla-root>/jdownloads.  The directories and files could have been uploaded using with say an FTP utility such as FileZilla, or by using your c-panel file manager or similar.

The default setup for the Check Download Area is a 'test run'.
Dependant on the settings then a test run is carried out so that one can see if there are any problems.  Once activated a new panel opens and shows the progress.  On completion the view is like the picture on the right, which was for a 'Full Scan'.

Part way down is a View Details button that will show the 'log' of the items added.  This is also available in the Monitoring Log option in the Information Area.
It is advised that you examine these details to confirm all is well.

At the bottom of the panel there is an option to make the changes permanent.  If making the changes permanent is choosen then jDownloads reruns the analysis but this time actually making the database entries.

Adding directories and files to create Categories and Downloads respectively involves making a significant number of database entries.  If there are only a modest number of existing Categories and Downloads, say around 1000 or less, and say just a couple of hundred new items one would do a Full Scan. This always searches all directories in the Download Area.
monitor01
But if there are many Categories or many Downloads already in jDownloads or you are adding a large number of directories and files then dependant upon your server the process may run out of the current PHP execution time limit.  Selecting in turn the options 'Search only for new directories' and  'Search only for new files' reduces the possibilty of exceeding the execution time limit.

There are five monitoring choices as noted below:
  1. Full scan
  2. Search only for new Directories
  3. Search only for new Files
  4. Check only for the existence of Categories
  5. Check only for the existence of Downloads
The first three options support the choice of a test run first. 
Full Scan  does what it says and looks for new directories and new files in the Download Area.  If it is not a test run then jDownloads will make the relevant database entries. Please see notes below about restricting the search region.
Search for New Directories will only look for new directories in the Download Area.  Again if it is not a test run then jDownloads will make the relevant database entries in the Category table.  Please see notes below about restricting the search region.
Search for New Files will only look for new files, which must be in an existing category in the Download Area.  Similarly  if it is not a test run then jDownloads will make the relevant database entries in the Downloads table.  As with the Categories Search, please see notes below about restricting the search region.
Check only for the existence of Categories makes a consistency check that the relevant directory as recorded in the Category database entry actually exists.  It always checks all  Categories, it does not look for new directories.  If the associated directory does not exist then the category is set as unpublised.  Details are given in the report.
Check only for the existence of Downloads makes a consistency check that the relevant file as recorded in the Download database entry actually exists.  It always checks all Downloads, itdoes not look for new files  Details are given in the report.

That is in the situation where you are dealing with a large number of entries then obviously do a Search only for new directories and, if successful, follow by Search only for new files.  To futher assist when there are a large number of entries to be checked please see the notes below about restricting the search region
monitor02
The other two options, Check only for the existence of Categories and Check only for the existence of Downloads, check the compatibility of the database entries for Categories and Downloads against the actual directories and files that exist on the server.  As an example a 'Check only for the existence of Categories' option was run.  If all is well then a message like the one on the right is shown.
To simulate a fault, the name of one of the directories was changed and the Check only for the existence of Categories option was run again as a 'Test Run'.  This time the message block showed the 'View Details' pulldown.  After clicking on View Details it showed that there was a missing directory.  If following the test Run you decide to make the change Permanent the the category will be unpublished.

It is recommended that if the 'View Details' link appears then you should use it to check the report.
monitor03
Adding directories and files to create Categories and Downloads respectively involves making a significant number of database entries.  If there are only a modest number of existing Categories and Downloads, say around 1000 or less, and say just a couple of hundred new items one would do a Full Scan. This always searches all directories in the Download Area for new directories and new files.
But if there are many Categories or many Downloads already in jDownloads or you are adding a large number of directories and files then dependant upon your server the process may run out of the current PHP execution time limit. 

Selecting in turn the options 'Search only for new directories' and 'Search only for new files' reduces the possibilty of exceeding the execution time limit.

Restricting the Search Region
To assist when there are a large number of entries to be checked there is an additional option in the Monitoring setup that allows selecting those directories that are to be either included or excluded in the monitoring. This limiting of the search path only applies to the 'Full Scan', the  'Search only for new directories' and the 'Search only for new files'.  The other two monitoring choices which Check for existence always search all directories. 

The monitoring report will give you a reminder that a selective search region has been set as illustrated opposite with the  " Not all! Selective search is set " messages.

The message shown was when using a Ful Scan.  For very large sites then a scheme is to do the 'Search only for new directories' and, if successful, follow by 'Search only for new files'.
monitor04
Configuring the Monitoring Options
From Joomla! 3.9 and higher, Configuring components such as jDownloads is  by clicking on an Options button in the component.  For jDownloads the Options button is on the top right of the Control Panel as illustrated below.
monitor05
 The settings relevant to the Check Download Area are in Options - Monitoring tab.
The Use Test Run is particularly useful as it allows checking of errors and how many new files and directories have already been created as Downloads and Categories, and how many of each type are to be added.

The Monitor All Files Types, when set to No, reveals another item "Monitor only the followingFile Types". [see below for more details]
This allows you to specify which file types are to be monitored.  The specific file types to be monitored are separated with a comma as for example 'zip,rar,exe,pdf'.

When "Monitor all Folders" is set to Yes then all Folders and Files as appropriate are examined for new items.  However if set to No then two more fields are shown allowing searching the jdownloads area on a more selective basis - see below for more detail.  [see below for more details]

The Default Downloads Description allows you to specify a default description for new Dowloads created by the monitoring process.

If "Optimise Server Settings" is set to Yes, jDownloads will try to optimise relevant server limits for the monitoring script to prevent timeouts. However in some situations it is useful to leave the server limits at their own values.

"View additional Information" allows some of the server settings used to be shown in the monitoring report.

"Maximum Monitoring Log File Size" is the size in Kilobytes for the maximum file size of the Monitoring Log file.  The file will be emptied when the maximum size is reached. Default: 32  - that is 32kb.
Note: this is not the Downloads logging file used in the User Limits checking.
monitor06

Monitor all file types
When set to No then the field 'Monitor only the following File Types' appears.
Enter the required types as a comma separated list as illustrated opposite.
monitor07

Monitor all Folders
When Monitor All Folders is set to No then two additional fields are shown.
The first one is a choice of Excluding or Including the specified Folders and any Files in those folders.  The second field shows the list of Folders that are to be include or excluded.  Each specified folder 'chain' is given on a separate line.
In the example opposite the first two lines shown correspond to top level categories.  The third line refers to a first level sub category.  As shown the monitoring would exclude the Public and TopA folders and all their sub folders, and also exclude Folder TopB/books and all sub folders of books.  It would however include folder TopB and all its sub folders except those in sub folder 'books'.
This example is illustrated below -the background colours are set to match the Exclude or Include colours.  Recall that the incude and exclude options apply to the contents of the folders which are any sub folders and files in them.
Note Do not include the Joomla! root or the base of the Downloads area.
monitor08
monitor09
In my test site about half the entries are in the Public and TopA categories and their sub categories.  So for monitoring one half I set 'Exclude' and for monitoring the other half I use 'Include'.

The Control panel main page will also summarise the main Monitoring settings.
monitor10
Colin Mercer February 2019

Print Email

This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.