Help › The cron job of the web server

The cron job of the web server

Online, a cron job added in cPanel runs every 5 minutes and does the background work of PunchPlus Web: reports, schedules and alerts by email, watched folders and the update check. The Home screen warns when it stops.

When PunchPlus Web runs online (on the web server, for example at punch.inforap.com), a cron job does its background work. A cron job is a command that cPanel runs on its own, on a schedule, even when nobody has PunchPlus Web open.

Every 5 minutes, the cron job:

  • notes that it ran (Settings shows the time of its last run);
  • checks for a new version of PunchPlus Web and of PunchPlus Clock, when the check is due (see Updates);
  • imports the files of the watched folders;
  • sends the PunchClock alerts and the follow-up alerts by email (see PunchClocks and Company and branches);
  • sends the reports and the work schedules that are due by email (see Reports by email).
Important: Online, nothing of this is done by the pages of PunchPlus Web: without the cron job, no report or alert leaves by email, the watched folders are not imported and no update is found. (The pages used to start this work themselves; on the web server, that work could stay stuck and keep PunchPlus Web busy until a restart, with Request Timeout on every page.)

On a computer (PunchPlus Web installed on a PC), there is no cron job: PunchPlus Web does all this itself while it is open.

How to add the cron job in cPanel

  1. In PunchPlus Web, open Settings, panel Reports by email, and copy the command shown there (it starts with cd /home/ and ends with -m punchweb.mailer). The warning of the Home screen shows the same command.
  2. In cPanel, search for Cron Jobs and open it.
  3. Under Add New Cron Job, in Common Settings, choose Once Per Five Minutes (*/5 * * * *).
  4. Paste the command in Command.
  5. Click Add New Cron Job.

Within 5 minutes, Settings shows the time of the last run under the command, and the warning disappears from the Home screen.

Note: cPanel emails what a cron job prints to the address of Cron Email at the top of the Cron Jobs page. The cron job of PunchPlus Web prints nothing when all goes well: you only get an email when a report could not be sent or something went wrong.

When the Home screen says the cron job is not running

The Home screen shows The cron job of the web server is not running when it has not run for more than 20 minutes (or never ran). Check in cPanel > Cron Jobs that the job is there, that it runs Once Per Five Minutes, and that its command is exactly the one shown in Settings (after a move of PunchPlus Web to another folder, the command changes).

To see what the cron job does, run it by hand: in cPanel, open Terminal and paste the command; it prints the errors, if any.

See also

This screen for the technical support

Print opens the print window with your default printer already chosen (a browser always asks before printing): choose "Save as PDF" there to get a file instead.

Changes not saved

You changed this record and did not save it.