Home / Support / Manuals / Administrators Guide /

Scheduled tasks

Manual in PDF format

1. General information

  • Scheduled tasks are programs that run in the background of the Windows operating system. Scheduled tasks are configured in the “ Task Scheduler”.
  • The purpose of scheduled tasks is to periodically run executable programs
    • once a day, weekly or monthly at a given time (hour and minute) – for example at 04:00 in the morning,
    • every day repeatedly from a given time (hour and minute) in a given interval (number of hours/minutes) and for a given time (number of hours) – for example from 06:00 in the morning in an interval of 30 minutes for 18 hours,
    • or in any combination and using restrictions on specific days – for example
      • every Monday, Wednesday and Friday at 22:00,
      • on the first of January, March and June at 08:00 in the morning,
      • etc.

1.1. Scripts on buttons (Button controls)

  • NET Genium uses scheduled tasks to periodically run scripts, defined within buttons located on view pages.
  • The “RunScript.exe” program, located in the “bin” directory of each NET Genium, is used to run the script defined by the button.
    • Use: “RunScript.exe <ID> [<UserID>]”
    • The “ID” parameter means the ID of the button, and it can be found in the admin mode in the tooltip that appears after stopping the mouse pointer over the link “Edit Button ID ...” or over the link “Edit script”.
    • The optional “UserID” parameter represents the ID of the user under whose login name the script will run. If the optional parameter is not specified, the script will run under an anonymous user.
  • Using a scheduled task, it is not possible to directly run scripts defined within the buttons located in edit forms. However, this limitation can be easily solved by launching a button on the view page, which then launches a button located in the edit form using the server function “SCHEDULESCRIPT(int button, int id)”.

1.2. Service tools

  • NET Genium also uses scheduled tasks to periodically run service tools:
    • Backing up databases and files using “BackupServer.exe”
    • Backing up databases using “SqlBackup.exe”
    • Backing up file attachments with “FileBackup.exe”
    • Automatically update NET Genium to the latest version using “Update.exe”
    • Periodically sending failed emails from the “Logs” directory using the “ResendEmlFiles.exe” program

2. Creating scheduled tasks with “Setup.exe” program

  • “Setup.exe” is the recommended method for creating scheduled tasks associated with the execution of button scripts located on browsing pages. Scheduled tasks created by the “Setup.exe” program can also be manually configured directly in the “Task Scheduler” or “Task Scheduler”.
  • All scheduled jobs are created in the “NET Genium” folder, which either already exists or is created by “Setup.exe”.
  • Scheduled jobs are set to run in the context of the user account “SYSTEM” with the highest privileges.
  • Run the “Setup.exe” program located in the “bin” directory of each NET Genium.

Obrázek.png

  • Check the options you want to choose as described below:
  • “Create scheduled task for BackupServer.exe (server backup)”
    • Check this option if you want to automatically create a scheduled task for regular backups of the server – database and directory.
  • “Create scheduled task for SqlBackup.exe (database backup)”
    • Check this option if you want to automatically create a scheduled task for regular database backups.
  • “Create scheduled task for FileBackup.exe (attachment backup)”
    • Check this option if you want to automatically create a scheduled task for regularly backing up file attachments.
  • “Create scheduled task for Update.exe (update)”
    • Check this option if you want to automatically create a scheduled task for regularly updating NET Genium to a new version.
  • “Create scheduled task for ResendEmlFiles.exe”
    • Check this option if you want to automatically create a scheduled task to periodically send failed emails from the “Logs” directory.
  • “Create scheduled task for RunScript.exe”
    • Check this option if you want to automatically create a scheduled task to run the script with the given ID, at a specified time, or with the possibility of repeating the task regularly 2x per hour for 18 hours.
  • Click the “Setup” button to start the installation. After the installation is complete, the program will display a message about this fact.
  • Run the “Task Scheduler” and check the created scheduled task, or change the user account in the context of which the scheduled task should be executed.
  • An additional user account change is necessary especially in situations where we plan to run a program with access to the database – “FileBackup.exe”, “Update.exe”, “ResendEmlFiles.exe” and “RunScript.exe” – and when the database server is installed on computer other than the application itself, or IIS. In this case, it is not possible to use the default user account “SYSTEM”, but typically the technology account defined in “Active Directory”.
  • Database backups are generally only possible from a computer that is also a database server. Therefore, it makes sense to run the “BackupServer.exe” and “SqlBackup.exe” programs only from a computer that is also a database server.