{"id":6627,"date":"2021-01-11T10:34:45","date_gmt":"2021-01-11T01:34:45","guid":{"rendered":"http:\/\/54.178.87.26\/background-task\/"},"modified":"2021-03-15T09:49:36","modified_gmt":"2021-03-15T00:49:36","slug":"background-task","status":"publish","type":"page","link":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/702\/admin\/howto\/background-task\/","title":{"rendered":"\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9 \u30bf\u30b9\u30af\u3092\u30a2\u30af\u30c6\u30a3\u30d6\u306b\u3059\u308b"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;Section&#8221; _builder_version=&#8221;4.4.2&#8243;][et_pb_row _builder_version=&#8221;4.4.2&#8243;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.4.2&#8243;][et_pb_text admin_label=&#8221;Activating the background task&#8221; _builder_version=&#8221;4.4.2&#8243; width=&#8221;100%&#8221;]<\/p>\n<h1 id=\"activating_the_background_task\" class=\"sectionedit1\">\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9 \u30bf\u30b9\u30af\u3092\u30a2\u30af\u30c6\u30a3\u30d6\u306b\u3059\u308b<\/h1>\n<p>\u3053\u306e\u6a5f\u80fd\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u5834\u5408\u3001TestRail \u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9 \u30bf\u30b9\u30af\u306f\u3001\u30c6\u30b9\u30c8\u304c\u5909\u66f4\u3055\u308c\u305f\u3068\u304d\u306b\u96fb\u5b50\u30e1\u30fc\u30eb\u901a\u77e5\u3092\u9001\u4fe1\u3059\u308b\u51e6\u7406\u306a\u3069\u3092\u884c\u3044\u307e\u3059\u3002\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9 \u30bf\u30b9\u30af\u306f\u5358\u7d14\u306a PHP \u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3001\u4e00\u5b9a\u306e\u9593\u9694\u3067\u8d77\u52d5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u884c\u3046\u6700\u3082\u7c21\u5358\u306a\u65b9\u6cd5\u306f\u3001\u30aa\u30da\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0 \u30b7\u30b9\u30c6\u30e0\u304c\u63d0\u4f9b\u3059\u308b\u30c4\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9 \u30b8\u30e7\u30d6\u3068\u3057\u3066\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3059\u308b\u3053\u3068\u3067\u3059\u3002Windows \u304a\u3088\u3073 Unix\/Linux \u30aa\u30da\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0 \u30b7\u30b9\u30c6\u30e0\u306b\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9 \u30bf\u30b9\u30af\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3001\u4ee5\u4e0b\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>[\/et_pb_text][et_pb_text admin_label=&#8221;Background task on Windows<br \/>\n&#8221; _builder_version=&#8221;4.4.2&#8243; width=&#8221;100%&#8221;]<\/p>\n<h2 id=\"windows_\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9_\u30bf\u30b9\u30af\" class=\"sectionedit2\">Windows \u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9 \u30bf\u30b9\u30af<\/h2>\n<div class=\"level2\">\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9 \u30bf\u30b9\u30af\u3092\u5b9a\u671f\u7684\u306b\u30c8\u30ea\u30ac\u30fc\u3059\u308b\u306b\u306f\u3001Windows \u30bf\u30b9\u30af \u30b9\u30b1\u30b8\u30e5\u30fc\u30e9\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u30bf\u30b9\u30af\u3092\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3059\u308b\u524d\u306b\u3001\u30b3\u30de\u30f3\u30c9 \u30e9\u30a4\u30f3 (x86 \u304a\u3088\u3073 x64) \u304b\u3089\u624b\u52d5\u3067\u30bf\u30b9\u30af\u3092\u5b9f\u884c\u3057\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9 \u30bf\u30b9\u30af\u304c\u6b63\u5e38\u306b\u958b\u59cb\u3055\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/div>\n<p>[\/et_pb_text][et_pb_text admin_label=&#8221;Code Sample&#8221; _builder_version=&#8221;4.4.2&#8243; background_color=&#8221;#ECF6FF&#8221; custom_padding=&#8221;4px|4px|2px|6px|false|false&#8221; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#C7DBEF&#8221;]<\/p>\n<pre class=\"code\">x86\u30b7\u30b9\u30c6\u30e0\u306e\u5834\u5408\uff1a\n&gt; \"C:\\Program Files\\PHP\\7.2\\php.exe\" \"C:\\inetpub\\wwwroot\\testrail\\task.php\"\n\n\u307e\u305f\u306f\u3001x64\u30b7\u30b9\u30c6\u30e0\u306e\u5834\u5408\uff1a\n&gt; \"C:\\Program Files (x86)\\PHP\\7.2\\php.exe\" \"C:\\inetpub\\wwwroot\\testrail\\task.php\"<\/pre>\n<p>[\/et_pb_text][et_pb_text admin_label=&#8221;Standard Text&#8221; _builder_version=&#8221;4.4.2&#8243; width=&#8221;100%&#8221;]<\/p>\n<p>TestRail \u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9 \u30bf\u30b9\u30af\u306f\u3001\u30bf\u30b9\u30af\u304c\u3059\u3067\u306b\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u81ea\u52d5\u7684\u306b\u691c\u51fa\u3057\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u6700\u826f\u306e\u7d50\u679c\u3092\u5f97\u308b\u306b\u306f\u3001\u975e\u5e38\u306b\u77ed\u3044\u9593\u9694 (1\u5206\u3054\u3068\u306a\u3069) \u3067\u30bf\u30b9\u30af\u3092\u8d77\u52d5\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002\u305d\u308c\u306b\u306f\u3001Windows \u30bf\u30b9\u30af \u30b9\u30b1\u30b8\u30e5\u30fc\u30e9\u30fc\u3092\u958b\u304d\u3001<strong>[<em>\u30bf\u30b9\u30af\u306e\u4f5c\u6210<\/em>]<\/strong> (Windows 2008 \u306e\u5834\u5408) \u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n<p>\u30bf\u30b9\u30af\u540d\u3092\u6307\u5b9a\u3057\u3001\u30ed\u30b0\u30aa\u30f3\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u304c\u3044\u306a\u304f\u3066\u3082\u30bf\u30b9\u30af\u3092\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;\/testrail\/docs\/702\/wp-content\/uploads\/task_general.png&#8221; _builder_version=&#8221;4.4.2&#8243;][\/et_pb_image][et_pb_text admin_label=&#8221;Standard Text&#8221; _builder_version=&#8221;4.4.2&#8243; width=&#8221;100%&#8221;]<\/p>\n<p><strong>[<em>\u30c8\u30ea\u30ac\u30fc<\/em>]<\/strong> \u30bf\u30d6\u3067\u65b0\u3057\u3044\u30c8\u30ea\u30ac\u30fc\u3092\u8ffd\u52a0\u3057\u3001\u30bf\u30b9\u30af\u3092\u3044\u3064\u5b9f\u884c\u3059\u308b\u304b\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;\/testrail\/docs\/702\/wp-content\/uploads\/task_trigger.png&#8221; _builder_version=&#8221;4.4.2&#8243;][\/et_pb_image][et_pb_text admin_label=&#8221;Standard Text&#8221; _builder_version=&#8221;4.4.2&#8243; width=&#8221;100%&#8221;]<\/p>\n<p>\u305d\u3057\u3066\u6700\u5f8c\u306b\u91cd\u8981\u306a\u3053\u3068\u3068\u3057\u3066\u3001TestRail \u30bf\u30b9\u30af \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u3092 <strong>[\u64cd\u4f5c]<\/strong> \u30bf\u30d6\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u306f PHP \u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3042\u308b\u305f\u3081\u3001php.exe \u304a\u3088\u3073 task.php \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30d1\u30b9\u3092\u5f15\u6570\u3068\u3057\u3066\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059 (\u5f15\u7528\u7b26\u3092\u542b\u3080)\u3002<\/p>\n<p>[\/et_pb_text][et_pb_text admin_label=&#8221;Code Sample&#8221; _builder_version=&#8221;4.4.2&#8243; background_color=&#8221;#ECF6FF&#8221; custom_padding=&#8221;4px|4px|2px|6px|false|false&#8221; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#C7DBEF&#8221;]<\/p>\n<pre class=\"code\">\"C:\\inetpub\\wwwroot\\testrail\\task.php\"<\/pre>\n<p>[\/et_pb_text][et_pb_image src=&#8221;\/testrail\/docs\/702\/wp-content\/uploads\/task_action.png&#8221; _builder_version=&#8221;4.4.2&#8243;][\/et_pb_image][et_pb_text admin_label=&#8221;Standard Text&#8221; _builder_version=&#8221;4.4.2&#8243; width=&#8221;100%&#8221;]<\/p>\n<p>\u30bf\u30b9\u30af\u30b9 \u30b1\u30b8\u30e5\u30fc\u30e9\u30fc\u00a0<abbr title=\"Graphical User Interface\">GUI<\/abbr> \u3092\u4f7f\u7528\u3059\u308b\u4ee3\u308f\u308a\u306b\u3001\u30b3\u30de\u30f3\u30c9 \u30e9\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u3066\u30bf\u30b9\u30af\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Windows Server 2008\u306e\u5834\u5408\uff1a<\/p>\n<p>[\/et_pb_text][et_pb_text admin_label=&#8221;Code Sample&#8221; _builder_version=&#8221;4.4.2&#8243; background_color=&#8221;#ECF6FF&#8221; custom_padding=&#8221;4px|4px|2px|6px|false|false&#8221; hover_enabled=&#8221;0&#8243; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#C7DBEF&#8221;]<\/p>\n<pre class=\"code\">x86\u30b7\u30b9\u30c6\u30e0\u306e\u5834\u5408\uff1a\n&gt; schtasks \/create \/np \/sc minute \/mo 1 \/tn \"TestRail Background Task\" \/tr \n  \"\\\"C:\\Program Files\\PHP\\7.2\\php.exe\\\" C:\\inetpub\\wwwroot\\testrail\\task.php\"\n\n\u307e\u305f\u306f\u3001x64\u30b7\u30b9\u30c6\u30e0\u306e\u5834\u5408\uff1a\n&gt; schtasks \/create \/np \/sc minute \/mo 1 \/tn \"TestRail Background Task\" \/tr \n  \"\\\"C:\\Program Files (x86)\\PHP\\7.2\\php.exe\\\" C:\\inetpub\\wwwroot\\testrail\\task.php\"<\/pre>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section][et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.4.2&#8243;][et_pb_row _builder_version=&#8221;4.4.2&#8243;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.4.2&#8243;][et_pb_text admin_label=&#8221;Background task on Unix\/Linux&#8221; _builder_version=&#8221;4.4.2&#8243; width=&#8221;100%&#8221;]<\/p>\n<h2 id=\"background_task_on_unixlinux\" class=\"sectionedit3\">Unix\/Linux \u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9 \u30bf\u30b9\u30af<\/h2>\n<div class=\"level2\">Unix\/Linux\u30b7\u30b9\u30c6\u30e0\u3067\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9 \u30bf\u30b9\u30af\u3092\u5b9a\u671f\u7684\u306b\u8d77\u52d5\u3059\u308b\u306b\u306f\u3001<code>cron<\/code> \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u30bf\u30b9\u30af\u3092\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3059\u308b\u524d\u306b\u3001\u30b3\u30de\u30f3\u30c9 \u30e9\u30a4\u30f3\u304b\u3089\u624b\u52d5\u3067\u30bf\u30b9\u30af\u3092\u5b9f\u884c\u3057\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9 \u30bf\u30b9\u30af\u304c\u6b63\u5e38\u306b\u958b\u59cb\u3055\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/div>\n<p>[\/et_pb_text][et_pb_text admin_label=&#8221;Code Sample&#8221; _builder_version=&#8221;4.4.2&#8243; background_color=&#8221;#ECF6FF&#8221; custom_padding=&#8221;4px|4px|2px|6px|false|false&#8221; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#C7DBEF&#8221;]<\/p>\n<pre class=\"code\">$ php \/var\/www\/html\/testrail\/task.php<\/pre>\n<p>[\/et_pb_text][et_pb_text admin_label=&#8221;Standard text&#8221; _builder_version=&#8221;4.4.2&#8243; width=&#8221;100%&#8221;]<\/p>\n<p id=\"background_task_on_unixlinux\" class=\"sectionedit3\">TestRail \u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9 \u30bf\u30b9\u30af\u306f\u3001\u30bf\u30b9\u30af\u304c\u3059\u3067\u306b\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u81ea\u52d5\u7684\u306b\u691c\u51fa\u3057\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u6700\u826f\u306e\u7d50\u679c\u3092\u5f97\u308b\u306b\u306f\u3001\u975e\u5e38\u306b\u77ed\u3044\u9593\u9694 (1\u5206\u3054\u3068\u306a\u3069) \u3067\u30bf\u30b9\u30af\u3092\u8d77\u52d5\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002\u305d\u308c\u306b\u306f\u3001\u30b7\u30b9\u30c6\u30e0\u306b cron \u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3001<code>\/etc\/cron.d\/testrail<\/code>\u00a0\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u6b21\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p>[\/et_pb_text][et_pb_text admin_label=&#8221;Code Sample&#8221; _builder_version=&#8221;4.4.2&#8243; background_color=&#8221;#ECF6FF&#8221; custom_padding=&#8221;4px|4px|2px|6px|false|false&#8221; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#C7DBEF&#8221;]<\/p>\n<pre class=\"code\">* * * * * www-data \/usr\/bin\/php \/var\/www\/html\/testrail\/task.php<\/pre>\n<p>[\/et_pb_text][et_pb_text admin_label=&#8221;Standard text&#8221; _builder_version=&#8221;4.4.2&#8243; width=&#8221;100%&#8221;]<\/p>\n<p id=\"background_task_on_unixlinux\" class=\"sectionedit3\">cron \u30b8\u30e7\u30d6\u306f PHP \u306e\u30b3\u30de\u30f3\u30c9 \u30e9\u30a4\u30f3 \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3092\u5fc5\u8981\u3068\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u3059\u3067\u306b\u30b7\u30b9\u30c6\u30e0\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002php -v \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u3059\u3067\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u30c6\u30b9\u30c8\u3067\u304d\u307e\u3059\u3002\u307e\u3060\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306e\u30d1\u30c3\u30b1\u30fc\u30b8 \u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u3092\u4f7f\u7528\u3057\u3066 php7.2-cli \u307e\u305f\u306f\u3053\u308c\u306b\u76f8\u5f53\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>[\/et_pb_text][et_pb_text admin_label=&#8221;Note&#8221; _builder_version=&#8221;4.4.2&#8243; background_color=&#8221;#ffffdd&#8221; custom_padding=&#8221;4px|4px|2px|6px|false|false&#8221; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#E1E163&#8243;]<\/p>\n<p><strong>\u6ce8\u610f\uff1a<\/strong>\u307e\u305f\u3001php-cli \u304c Web \u30b5\u30fc\u30d0\u30fc\u306e PHP.ini \u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3057\u306a\u3044\u5834\u5408\u306f\u3001php-cli \u306e PHP.ini \u306b\u4e0a\u8a18\u306e PHP \u62e1\u5f35\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002Ubuntu \u30b7\u30b9\u30c6\u30e0\u3067\u306f\u3001\u00a0<code>\/etc\/php\/7.2\/cli\/php.ini<\/code> \u306b ioncube \u62e1\u5f35\u6a5f\u80fd\u3082\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;Section&#8221; _builder_version=&#8221;4.4.2&#8243; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":6645,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"[et_pb_section fb_built=\"1\" admin_label=\"Section\" _builder_version=\"4.4.2\"][et_pb_row _builder_version=\"4.4.2\"][et_pb_column type=\"4_4\" _builder_version=\"4.4.2\"][et_pb_text admin_label=\"Activating the background task\" _builder_version=\"4.4.2\" width=\"100%\"]\n<p id=\"background_task_windows\"><\/p>\n\n<h1 id=\"activating_the_background_task\" class=\"sectionedit1\">Activating the Background Task<\/h1>\nThe TestRail background task is responsible, among other things, for sending out email notifications for test changes if this feature is enabled. The background task is a simple PHP script that needs to be triggered at regular intervals to do its work.\n\nThe easiest way to do this is to schedule it as a background job with the tools your operating system provides. See below on how to install the background task on Windows and Unix\/Linux operating systems.\n\n[\/et_pb_text][et_pb_text admin_label=\"Background task on Windows\n\" _builder_version=\"4.4.2\" width=\"100%\"]\n<h2 id=\"background_task_on_windows\" class=\"sectionedit2\">Background task on Windows<\/h2>\n<div class=\"level2\">We use the Windows Task Scheduler to trigger the background task periodically. Before scheduling the task, you can verify that it can be successfully started by running it manually from the command line (x86 and x64):<\/div>\n[\/et_pb_text][et_pb_text admin_label=\"Code Sample\" _builder_version=\"4.4.2\" background_color=\"#ECF6FF\" custom_padding=\"4px|4px|2px|6px|false|false\" border_width_all=\"1px\" border_color_all=\"#C7DBEF\"]\n<pre class=\"code\">&gt; \"C:Program FilesPHP7.2php.exe\" \"C:inetpubwwwroottestrailtask.php\"\n&gt; REM Or, for x64 systems:\n&gt; \"C:Program Files (x86)PHP7.2php.exe\" \"C:inetpubwwwroottestrailtask.php\"<\/pre>\n[\/et_pb_text][et_pb_text admin_label=\"Standard Text\" _builder_version=\"4.4.2\" width=\"100%\"]\n\nThe TestRail background task automatically detects if it's already running, so it's best to trigger the task in very short intervals (such as every minute) for best results. To do this, open the Windows Task Scheduler and select\u00a0<strong>Create Basic Task<\/strong>\u00a0(Windows 2008).\n\nNow, specify a task name and select to trigger the task even if no user is logged on:\n\n[\/et_pb_text][et_pb_image src=\"https:\/\/media.gurock.com\/gk-media\/screenshots\/user-guide\/task_general.png\" _builder_version=\"4.4.2\"][\/et_pb_image][et_pb_text admin_label=\"Standard Text\" _builder_version=\"4.4.2\" width=\"100%\"]\n\nOn the\u00a0<strong>Triggers<\/strong>\u00a0tab, add a new trigger to specify when the task should be executed:\n\n[\/et_pb_text][et_pb_image src=\"https:\/\/media.gurock.com\/gk-media\/screenshots\/user-guide\/task_trigger.png\" _builder_version=\"4.4.2\"][\/et_pb_image][et_pb_text admin_label=\"Standard Text\" _builder_version=\"4.4.2\" width=\"100%\"]\n\nAnd last but not least, add the action to execute the TestRail task script on the <strong>Actions<\/strong> tab.\n\nBecause the script is a PHP script, we need to specify the path of the php.exe and the task.php script as an argument (including quotes):\n\n[\/et_pb_text][et_pb_text admin_label=\"Code Sample\" _builder_version=\"4.4.2\" background_color=\"#ECF6FF\" custom_padding=\"4px|4px|2px|6px|false|false\" border_width_all=\"1px\" border_color_all=\"#C7DBEF\"]\n<pre class=\"code\">\"C:inetpubwwwroottestrailtask.php\"<\/pre>\n[\/et_pb_text][et_pb_image src=\"https:\/\/media.gurock.com\/gk-media\/screenshots\/user-guide\/task_action.png\" _builder_version=\"4.4.2\"][\/et_pb_image][et_pb_text admin_label=\"Standard Text\" _builder_version=\"4.4.2\" width=\"100%\"]\n\nAlternatively to using the Task Scheduler\u00a0<abbr title=\"Graphical User Interface\">GUI<\/abbr>, you can also create the task using the command line. For example, on Windows Server 2008:\n\n[\/et_pb_text][et_pb_text admin_label=\"Code Sample\" _builder_version=\"4.4.2\" background_color=\"#ECF6FF\" custom_padding=\"4px|4px|2px|6px|false|false\" hover_enabled=\"0\" border_width_all=\"1px\" border_color_all=\"#C7DBEF\"]\n<p id=\"background_task_unix_linux\"><\/p>\n<p style=\"margin: 0in; font-family: Calibri; font-size: 11.0pt;\">&lt;p id=\"background_task_on_unix_linux\"&gt;&lt;\/p&gt;<\/p>\n\n<pre class=\"code\">&gt; schtasks \/create \/np \/sc minute \/mo 1 \/tn \"TestRail Background Task\" \/tr\n    \"\"C:Program FilesPHP7.2php.exe\" C:inetpubwwwroottestrailtask.php\"\n&gt; REM Or, for x64 systems:\n&gt; schtasks \/create \/np \/sc minute \/mo 1 \/tn \"TestRail Background Task\" \/tr\n    \"\"C:Program Files (x86)PHP7.2php.exe\" C:inetpubwwwroottestrailtask.php\"<\/pre>\n[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section][et_pb_section fb_built=\"1\" _builder_version=\"4.4.2\"][et_pb_row _builder_version=\"4.4.2\"][et_pb_column type=\"4_4\" _builder_version=\"4.4.2\"][et_pb_text admin_label=\"Background task on Unix\/Linux\" _builder_version=\"4.4.2\" width=\"100%\"]\n<h2 id=\"background_task_on_unixlinux\" class=\"sectionedit3\">Background task on Unix\/Linux<\/h2>\n<div class=\"level2\">We use\u00a0<code>cron<\/code>\u00a0to trigger the background task on Unix\/Linux systems periodically. Before scheduling the task, you can verify that it can be successfully started by running it manually from the command line:<\/div>\n[\/et_pb_text][et_pb_text admin_label=\"Code Sample\" _builder_version=\"4.4.2\" background_color=\"#ECF6FF\" custom_padding=\"4px|4px|2px|6px|false|false\" border_width_all=\"1px\" border_color_all=\"#C7DBEF\"]\n<pre class=\"code\">$ php \/var\/www\/html\/testrail\/task.php<\/pre>\n[\/et_pb_text][et_pb_text admin_label=\"Standard text\" _builder_version=\"4.4.2\" width=\"100%\"]\n<p id=\"background_task_on_unixlinux\" class=\"sectionedit3\">The TestRail background task automatically detects if it's already running, so it's best to trigger the task in very short intervals (such as every minute) for best results. To do this, make sure cron is installed on your system and create a file\u00a0<code>\/etc\/cron.d\/testrail<\/code>\u00a0with the following content:<\/p>\n[\/et_pb_text][et_pb_text admin_label=\"Code Sample\" _builder_version=\"4.4.2\" background_color=\"#ECF6FF\" custom_padding=\"4px|4px|2px|6px|false|false\" border_width_all=\"1px\" border_color_all=\"#C7DBEF\"]\n<pre class=\"code\">* * * * * www-data \/usr\/bin\/php \/var\/www\/html\/testrail\/task.php<\/pre>\n[\/et_pb_text][et_pb_text admin_label=\"Standard text\" _builder_version=\"4.4.2\" width=\"100%\"]\n<p id=\"background_task_on_unixlinux\" class=\"sectionedit3\">The cron job needs the PHP command line interface, which might already be installed on your system. You can test this by executing the php -v command. If it's not already installed, install the php7.2-cli package or equivalent with your platform's package manager.<\/p>\n[\/et_pb_text][et_pb_text admin_label=\"Note\" _builder_version=\"4.4.2\" background_color=\"#ffffdd\" custom_padding=\"4px|4px|2px|6px|false|false\" border_width_all=\"1px\" border_color_all=\"#E1E163\"]\n\n<strong>Please note:<\/strong>\u00a0Also make sure to add the above mentioned PHP extensions to the php-cli's PHP.ini if it doesn't use the web server's PHP.ini file. E.g., on Ubuntu systems, also add the ioncube extension to\u00a0<code>\/etc\/php\/7.2\/cli\/php.ini.<\/code>\n\n[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]","_et_gb_content_width":"","footnotes":""},"class_list":["post-6627","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/702\/wp-json\/wp\/v2\/pages\/6627","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/702\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/702\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/702\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/702\/wp-json\/wp\/v2\/comments?post=6627"}],"version-history":[{"count":7,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/702\/wp-json\/wp\/v2\/pages\/6627\/revisions"}],"predecessor-version":[{"id":9643,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/702\/wp-json\/wp\/v2\/pages\/6627\/revisions\/9643"}],"up":[{"embeddable":true,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/702\/wp-json\/wp\/v2\/pages\/6645"}],"wp:attachment":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/702\/wp-json\/wp\/v2\/media?parent=6627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}