Cron jobs
Some work in Easy Jobs Manager runs on a schedule. There are three ways it is started:
| Task | How it runs | Guide |
|---|---|---|
| Job alerts to candidates | A cron job that calls a web address | Job alerts |
| Moving partner jobs to the top | A cron job that calls a web address | Below |
| Expiry emails to companies | Joomla's Task Scheduler | Expiry notifications |
| CSV import from a file on the server | A cron job that runs the Joomla console | CSV import |
Set the cron key
The two web addresses only run with your secret key.
- Open Options > Other.
- Enter a long random value in Cron Task Key, for example 32 letters and numbers.
- Click Save.
While the key is empty or still brekeke, the value in the field after installing, both addresses answer with an "Access denied" message about an invalid key and do nothing. Keep the key secret: anyone who has it can start the job alert emails.
Send job alerts
https://www.example.com/index.php?option=com_easyjobsmanager&task=misc.notify_new_jobs&key=YOURKEY
Run it once a day. Extra parameters:
| Parameter | Default | What it does |
|---|---|---|
days |
1 | How many days back to look for new jobs. Use 2 when the cron job runs every second day |
limit |
15 | The most jobs in one email |
With days=1 the alerts are sent only once a day, even when the address is called again. The date of the last run is kept in components/com_easyjobsmanager/controllers/job_alert_datetime.php. To test again on the same day, delete that file. Each run writes to easyjobsmanager_job_alert.log.php in Joomla's log folder.
Move partner jobs to the top
https://www.example.com/index.php?option=com_easyjobsmanager&task=misc.move_partner_jobs&key=YOURKEY
This finds the online jobs of partner companies that went online exactly 7 days ago and sets their Start publishing to now. The jobs list is sorted by that date by default, so these jobs show at the top again, once a week. The end date does not change, and jobs without an end date are left alone. Run it once a day. With days=14 it moves jobs every two weeks instead. It writes to easyjobsmanager_job_move.log.php.
Example crontab
0 7 * * * curl -s "https://www.example.com/index.php?option=com_easyjobsmanager&task=misc.notify_new_jobs&key=YOURKEY" > /dev/null
15 7 * * * curl -s "https://www.example.com/index.php?option=com_easyjobsmanager&task=misc.move_partner_jobs&key=YOURKEY" > /dev/null
*/15 * * * * php /path/to/site/cli/joomla.php scheduler:run > /dev/null
The last line runs Joomla's Task Scheduler, which sends the expiry emails. Most hosting control panels have a "Cron jobs" screen where you can enter the same commands.