Cronjob Handler

Are you new to the eduTrac SIS online user's manual? If so, click here for a starting point. If you are looking for technical documentation, then check out the Wiki.

 

Cronjobs are very important in the running and maintenance of eduTrac SIS (etSIS). When you first setup etSIS, you need to setup cronjob handlers (Screens > Administrative > Cronjob Handler). On the Cronjob Handler settings screen (Cronjob Handler > Settings) you must enter a password and the time in seconds that the cronjob should run before timing out.

Setting Up New Handlers

new-cronjob-handler

  1. Handler Name – Name of the handler to run.
  2. Cronjob URL – Url of the handler to run.
  3. Each / Time – Set the time for when the cronjob should run (i.e. every 2 minutes, every 5 minutes, or every Day at 07:00).
  4. Set the handler to Active or Inactive.

Once you’ve setup your cronjob handlers, you will need to create a cronjob on your server either through your hosting control panel or by using these instructions. The master cronjob should run every minute and should be setup like so:

* * * * * http://replace_url/cron/master/

Below is the a list of handlers that need to be setup in the system. You will need to replace the replace_url with the url of your installation.

NameScript PathSuggested Time Interval
Purge Activity Loghttp://replace_url/cron/purgeActivityLog/Every Hour
Update Student Termshttp://replace_url/cron/updateSTTR/Every 7 days
Update Student Academic Levelshttp://replace_url/cron/updateSTAL/Every 7 days
Run Email Queuehttp://replace_url/cron/runEmailQueue/Every 5 Minutes
Run Bounce Handlerhttp://replace_url/cron/runBounceHandler/Every day
Run Graduationhttp://replace_url/cron/runGraduation/Every hour
Purge Error Loghttp://replace_url/cron/purgeErrorLog/Every 30 minutes
Purge Saved Querieshttp://replace_url/cron/purgeSavedQuery/Every 30 days
Check Student Balancehttp://replace_url/cron/checkStuBalance/Every 5 minutes
Run NodeQhttp://replace_url/cron/runNodeQ/Every 5 minutes
Backup Databasehttp://replace_url/cron/runDBBackup/Default: every day, but feel free to change it to how often you want to backup your database.
Backup Systemhttp://replace_url/cron/runSiteBackup/Default: every day, but feel free to change it to how often you want to backup your system. This does not backup system session savepath files set in config.php
Academic Level Standinghttp://replace_url/cron/runALST/Every 7 days

Last Modified: Aug 17, 2017 @ 4:34 PM

Was this article helpful?

Related Articles

  • Teja Majety
    Moderator
    • Topics: 12
    • Replies: 204
    • Total Posts: 216

    Hi,

    I am trying to set some Cron job handlers, but I think there seem to be some issues with the way I setup. Could you please suggest me something here.

    I created some new cronjob handlers as mentioned here and created a cronjob on the server as well.

    Do I need to create individual cronjobs on the server for each handler in the system? or only one for all cronjob handlers as mentioned on this page?
    */5 * * * * /usr/bin/php -q -f /var/www/localhost/app/views/cron/cronjob password=yourpassword
    */5 * * * * http://localhost/erp/cron/cronjob?password=yourpassword
    I created one of the above like

     

    http://mywebsiteURL/erp/cron/updateStuTerms/ –Created in the system.

     

    MAILTO=”****@mail.com”

    */5 * * * * http://mywebsiteURL/erp/cron/updateStuTerms?password=myownpassword –Created in server

    But the issue is, I just gave the option to see if the Cron job is working or not. Now iIget the emails like

    /bin/sh:http://mywebsiteURL/<wbr />erp/cron/cronjob?password=mypassword: No such file or directory

    Could not open input file: /var/www/html/app/views/cron/updateStuTerms

    /bin/sh: http://mywebsiteURL/<wbr />erp/cron/runDBBackup?password=mypassword: No such file or directory

    So am I missing something here?

    • This reply was modified 4 years, 2 months ago by  Teja Majety.
    Teja Majety
    Moderator
    • Topics: 12
    • Replies: 204
    • Total Posts: 216
    This reply has been marked as private.
    Joshua Parker
    Keymaster
    • Topics: 4
    • Replies: 638
    • Total Posts: 642

    You only need one master cronjob on the server. Your url may not be correct (http://mywebsiteURL/erp/cron/updateStuTerms?password=myownpassword). In the example, “erp” is the directory where eduTrac SIS is installed, it is not part of the url. So, if you added that, then it should be this:

    */5 * * * * http://replace_url/cron/updateStuTerms?password=myownpassword

     

    Teja Majety
    Moderator
    • Topics: 12
    • Replies: 204
    • Total Posts: 216
    This reply has been marked as private.
    Joshua Parker
    Keymaster
    • Topics: 4
    • Replies: 638
    • Total Posts: 642

    Where is /bin/sh coming from? This is not a bash or shell script.

    • This reply was modified 4 years, 2 months ago by  Joshua Parker.
    Teja Majety
    Moderator
    • Topics: 12
    • Replies: 204
    • Total Posts: 216

    It bugs me as well, and I checked with Cron job that  I have created on the server, and there isn’t any that kind of script.

    I have attached that Cron job screen shot in before post. Only the mail output is exhibiting that.

    How does this Cron job handler actually works? When we create a new handler in the system, does it create any file or folder under that name in (/app/view/cron/) folder?

    If it is the case the I don’t have any files/folder under the name of the handlers that I have created in the system.

     

    Joshua Parker
    Keymaster
    • Topics: 4
    • Replies: 638
    • Total Posts: 642

    It creates a directory based on the hostname. For example, if the domain is http://www.etsis.com, then under /app/views/cron, you should see a new folder called www. In that folder there will be a logs folder and two encrypted files. Nevertheless, it relies on the master cron created on the server. The master cron will run each cron handler as a separate cron job based on the cronjob handler’s time interval.

    I think amazon maybe automatically placing /bin/sh before your cron. So try the following solution to see if it may fix your issue.

    */5 * * * * /usr/bin/wget -O- http://replace_url/cron/cronjob?password=yourpassword

     

    Teja Majety
    Moderator
    • Topics: 12
    • Replies: 204
    • Total Posts: 216
    This reply has been marked as private.
    Joshua Parker
    Keymaster
    • Topics: 4
    • Replies: 638
    • Total Posts: 642

    With regards to the master cron (cronjob on the server), there is a difference between

    */5 * * * * /usr/bin/wget -O- http://replace_url/cron/updateStuTerms?password=yourpassword

    and

    */5 * * * * /usr/bin/wget -O- http://replace_url/cron/cronjob?password=yourpassword

    The first one is wrong. The first one is calling only the cronjob handler for updateStuTerms. The second one will run all the cronjob handlers. Each cronjob handler will run based on the time interval you have set for that handler.

    If one cronjob handler is set to run every hour, then it will run every hour. If another cronjob handler is set to run every 5 minutes, then it will run every 5 minutes and so on. Even though the master cronjob runs every 5 minutes, each cronjob handler will only run based on the time interval that was set for it specifically.

    Teja Majety
    Moderator
    • Topics: 12
    • Replies: 204
    • Total Posts: 216

    Thanks, Parker that clears all my issues regarding Cron jobs.

    One last thing if you don’t mind. The Backup Database in Cron jobs, does it really backup my database? If yes where does it store?

    Generally we backup the system files and database files with Cron or some other means. So what does this Database Backup do?

    Joshua Parker
    Keymaster
    • Topics: 4
    • Replies: 638
    • Total Posts: 642

    Yes, it will backup the database, and download it to the place where logged in cookies are stored on the server. If you are running your own backups (which I highly recommend), you can ignore this cronjob handler. I myself use a script to backup the system to an Amazon S3 Bucket.

    Michael Williams
    Member
    • Topics: 2
    • Replies: 38
    • Total Posts: 40

    I have the cronjobs setup but when I create a new student or staff account in EduTracSis it does not actually email them their username and temporary password.  I even had my host provider check the cronjobs to make sure they were correct.  What could be the problem and how do I fix it?

    Teja Majety
    Moderator
    • Topics: 12
    • Replies: 204
    • Total Posts: 216

    Getting automated mail when an “applicant” is moved to “student” has nothing to do with Cron job. You have to select “yes” for “Applicant Email” in General Settings.

    If you are talking about creating a person record then you have to “Tick/Check” the option for “Send username & password to the user”. you can find this under “Person Role” field in New Person form.

    So every time when you are creating a person record you have to check this option to send the details through Email.

    Michael Williams
    Member
    • Topics: 2
    • Replies: 38
    • Total Posts: 40

    Yes, I do have “Send username & password to the user” checked.  It still does nothing.  I also have that checked for new applicants.

    Michael Williams
    Member
    • Topics: 2
    • Replies: 38
    • Total Posts: 40

    using the SMTP plugin is not working.  I get the following when trying to activate the pluging:

     

    The plugin etsis-smtp.plugin.php has been deactivated because your changes resulted in a fatal error.

    The following function is already defined elsewhere: etsis_smtp_page

     

    I am using EduTracSiS version 6.2.9

Viewing 15 posts - 1 through 15 (of 29 total)

You must be logged in to reply to this topic.