job_management.rst 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. Job Management
  2. ===============
  3. This module is meant to provide a simple means of creating a robust command-line-driven, fully bootstrapped PHP Daemon. It uses the PHP-Daemon (https://github.com/shaneharter/PHP-Daemon) Library to create the Daemon (via the Libraries API) in order to not re-invent the wheel ;-).
  4. Features
  5. ~~~~~~~~~
  6. * Provides a Drush interface to start/stop your Daemon.
  7. * Your daemon starts in the background and is detached from the current terminal.
  8. * Daemon will run all Tripal Jobs submitted within 20 seconds.
  9. * A log including the number of jobs executed, their identifiers and results.
  10. * Lock Files, Automatic restart (8hrs default) and Built-in Signal Handling & Event Logging are only a few of the features provided by the Daemon API making this a fully featured & robust Daemon.
  11. Requirements
  12. ~~~~~~~~~~~~~
  13. * Libraries API (https://www.drupal.org/project/libraries)
  14. * PHP-Daemon Library version 2.0 (https://github.com/shaneharter/PHP-Daemon)
  15. * Download the PHP-Daemon Library and extract it in your ``sites/all/libraries`` directory. The folder must be named "PHP-Daemon".
  16. * Drush 5.x (https://github.com/drush-ops/drush)
  17. * Drush Daemon API (https://www.drupal.org/project/drushd)
  18. Tripal Daemon Usage
  19. ~~~~~~~~~~~~~~~~~~~~~
  20. .. code-block:: shell
  21. #Start Daemon drush
  22. trpjob-daemon start
  23. #Stop Daemon
  24. drush trpjob-daemon stop
  25. #Check the Status
  26. drush trpjob-daemon status
  27. #Show the Log
  28. #List the last 10 lines of the log file:
  29. drush trpjob-daemon show-log
  30. #List the last N lines of the log file:
  31. drush trpjob-daemon show-log --num_lines=N