Automatic Publication at Scheduled Times (Cron job)
Another situation is that you need to create a large number of Downloads. These could have been setup on a test site and now you want to upload and publish them.
Transfering a large number of files in a directory structure from your PC to your website is readily achieved using your an ftp program such as FileZilla. These downloads, and possibly new categories, will need creating into Downloads and publishing.
Doing this automaticly on a scheduled basis is known as a 'Cron job'.
If 'Monitor all file types' is set to No then another option becomes available that allows you to specify file types.
Similarly if 'Monitor All Folders' is set to No then further options allow specifying which Categories are to be included or excluded.
For more details on the Monitoring options please see the article Monitoring Options and Checking the Download Area (opens in a new window/tab).
If you, as the administrator, are initially copying over large number of files you probably would set "Automatically publish Downloads?" to Yes. But later if you open it up to some general users then you may wish to review each Download before publishing it by setting "Automatically publish Downloads?" to No. That is set it to whichever way suits your current needs.
This is not always convenient. A solution is to have the scanning scheduled to run periodically or at some fixed time from your web site services. Such a facility is often referred to as a 'Cron job'.
This 'command' will include what is known as the 'key' as a security check. The form of the command is:
where the key part is unique to your specific site.
This secret key, this-is-a-key, is the one created by Joomla! for your site. It may be found in the Joomla! System - System Information - Configuration tab. Scroll down until you find the Secret key. It is usually a 32 character sequence such as for example say 'stoAs118BoemlusWO1mlaxoesPl9wrlU' - (this example secret key is artificial and not real). With this secret key the fullversion of the command would look like
However as the default values for mode and test are zero then the following command, which is compatible with the one used in jD 3.2 series, will also work:
jDownloads compares the key supplied in the command with the one in your Joomla! configuration file so that no one else can initiate a Cron on your site.
(a) &mode=0 : do all (default setting)
(b) &mode=1 : only search for new Categories
(c) &mode=2 : only search for new Files
(d) &mode=3 : only check existence of Categories
(e) mode = 4 : only check existence of Files
The value of test should always be 0 that is &test=0
Using cPanel Cron job
These notes apply to cPanel version 88.0.33 but all recent versions are very similar.
You just put in your email address into the appropriate field.
You can either use the current email or select a new one.
If you have multiple cron jobs there is a way of selectively setting which cron jobs will not send an email.
Setting up the schedule times for the cron to run is reasonably simple.
The easiest way is to use is the common settings which can be readily adjusted in the individual time parts.
In the example shown opposite the schedule is twice a day at 00 and 12:00 on every day.
One could edit the hour part to say 1 and 5 to give an unequal spacing.
The Command part is simply
where your-key is the Joomla! Secret key specific to your site (see System - Site Information - Configuration tab Secret field), and the <your_site> is replaced by www.yoursite.com as appropriate.
After clicking on the 'Add New Cron Job' button a line appears something like opposite.
If the cron job does not run then you should initially check with yout host site provider as they may have imposed some restricions such as a minimum time interval.
Joomla! Extensions for Cronjobs
There are also some such as the JoomlaShack jPrc (opens in new window/tab) and No Boss Cron (opens in new window/tab) which have an effective way of simulating a cron job.
Web based Cron Jobs
To find some try searching with a phrase like 'cron services'.
Some free ones require you to renew every month.
But there are others such as https://cron-job.org/ (opens in new window/tab) that allow you permanent access.
Setup is simple as illustrated opposite.
There are also some additional options about email notification should a cron job fail.
The time string is made up of 5 items specifying: minutes, hours, days, months and weekdays. The syntax is five space separated 'values'; but the values not always obvious!
Some examples are given below but if you want to determine other time strings then you could look at http://crontab-generator.org/ (opens in new window/tab). All times are usually UTC based so you may need to take that into account.
Time string */30 4 * * * would cause execution every day at 4:00 and 4:30.
Time string 3 4 * * * is once a day at 4:03 am
Time string */20 * * * * is every 20 minutes
The general structure of the command part for use with jDownloads is the unix command: "curl -s /dev/null http://websitename/script-name"
Specifically something like:
curl -s /dev/null http://<your_site>/jda1/administrator/components/com_jdownloads/helpers/scan.php?key=qwertySS1zW0kIdQ1VZ7xxxyyy
which also includes the Secret key specific to your site as described above. The key shown is of course not a real one!
Colin Mercer July 2019, updated August 2020, June 2023