Cron

提供:MoodleDocs
移動先:案内検索


再作成中です - Mitsuhiro Yoshida (トーク)

The Moodle 'cron' process is a PHP script (part of the standard Moodle installation) that must be run regularly in the background. The Moodle cron script runs different tasks at differently scheduled intervals. Moodleの「cron」プロセスはバックグラウンドで定期的に実行される (標準的なMoodleインストレーションの一部) PHPスクリプトです。Moodle cronスクリプトは異なるスケジュール間隔で異なるタスクを実行します。

IMPORTANT: Do not skip setting up the cron process on your server for your Moodle. Your site will not work properly without it. 重要: あなたのMoodleサーバのcronプロセスの設定をスキップしないでください。あなたのサイトはcronプロセスの設定なしでは正しく動作しません。

It is recommended that the cron is run every minute, as required for asynchronous activity deletion when using the recycle bin. ごみ箱を使用する場合、非同期で活動を削除する必要があるため、1分ごとのcron実行を推奨します。

The cron program (that runs the Moodle script) is a core part of Unix-based systems (including Linux and OSX) being used to run all manner of time-dependent services. cronプログラム (Moodleスクリプトを実行) はUnixベースのシステム (LinuxおよびOSXを含む) の中核部分であり、時間に依存するあらゆるサービスを実行するために使用されます。On Windows the simplest solution is to create a task in the Windows Task Scheduler and set it to run at regular intervals. Windowsの場合、最も簡単な解決策はWindowsタスクスケジューラでタスクを作成して定期的に実行するよう設定することです。On shared hosting, you should find the documentation (or ask support) how cron is configured. 共有ホスティングではcronがどのように設定されているかドキュメントを探す (またはサポートに問い合わせる) 必要があります。Most shared hosting systems use CPanel to manage sites, and usually will have a section for Cron Jobs on the panel.ほとんどの共有ホスティングシステムはサイトを管理するためにCPanelを使用しており、通常パネル上にCron Jobsセクションがあります。

Essentially, the task involves adding a single command to the list of cron activities on your system. On Unix based systems this list is a file called a 'crontab' which all users have. 基本的にこのタスクはシステム上のcron活動のリストに1つのコマンドを追加することを含みます。Unixベースのシステムではこのリストは「crontab」と呼ばれるファイルであり、すべてのユーザが持っています。

一般的な議論General discussion

See the later sections for your server type; this section contains some general background information. サーバのタイプに関して、後のセクションを参照してください。 このセクションには一般的な背景情報が含まれます。

There are essentially two steps to implementing cron: cronの導入には基本的に2つのステップがあります:

  1. identifying the correct command to run
  2. finding the right place on your system to put the command
  3. 実行すべき正しいコマンドを特定する
  4. コマンドを実行する正しい場所をシステム上で見つける

Working out the Moodle cron command

Moodle has two different ways to deploy cron which use different scripts within the Moodle install. These are as follows... MoodleにはMoodleインストール内で異なるスクリプトを使用する2つの異なるcron配置方法があります。これらは以下のとおりです...

  1. The CLI (command line interpreter) script. CLI (コマンドラインインタプリタ) スクリプト。これは次のようなパスになります:
    /path/to/moodle/admin/cli/cron.php
    This will be at the path
    /path/to/moodle/admin/cli/cron.php
    疑問がある場合は、これが使用するための正しいスクリプトです。If in doubt, this is the correct script to use. This needs to be run by a 'PHP CLI' program on your computer. 最後のコマンドラインは次のようになります:
    /usr/bin/php /path/to/moodle/admin/cli/cron.php
    So the final command may look something like
    /usr/bin/php /path/to/moodle/admin/cli/cron.php
    You can (and should) try this on your command line to see if it works. WARNING: Check your command-line PHP version is compatible with your chosen version of Moodle. The command-line PHP program is different to the one running your web site and is not always the same version.
  2. If, for some reason, you cannot run the CLI script there is the web based script. Note that this is now deprecated and may be removed in future versions. This needs to be run from a web browser and will be accessed via a web url something like http://your.moodle.site/admin/cron.php. You can find command line based web browser (e.g. wget) so the final command may look like
    /usr/bin/wget http://your.moodle.site/admin/cron.php
    This has the advantage that it can be run from *anywhere*. If you can't get cron to work on your machine it can be run somewhere else.

The web based Moodle cron command

  • If you have a choice, do not use the web based cron. It is likely to be removed in a future Moodle version.
  • From Moodle 2.9 onwards, the cron job can no longer be run from web by default. You will get an error message:
!!! Sorry, internet access to this page has been disabled by the administrator. !!! 
  • You can change this in ' Dashboard ► Site administration ► Security ► Site policies ' by deselecting 'Cron execution via command line only'.
    • You will be warned that 'Running the cron from a web browser can expose privileged information to anonymous users. Thus it is recommended to only run the cron from the command line or set a cron password for remote access.'
    • You can then write a 'Cron password for remote access'. If this field is left empty, no password is required.
    • This means that the cron.php script cannot be run from a web browser without supplying the password using the following form of URL:
 http://site.example.com/admin/cron.php?password=opensesame

Finding the right place to put the command

This really does depend on the system you are using and you should find and read the documentation for your platform or hosting. In most cases getting the Moodle cron to run consists of establishing the correct command (above) and then adding it, and the time to run the command, to some sort of file. This might be either through a specific user interface or by editing the file directly.

If using the CLI version you also need to make sure that the cron process is run as the correct user. This is not an issue with the web version.

Example... installing cron on Ubuntu/Debian Linux. Assuming logged in as root..

use the crontab command to open a crontab editor window for the www-data user. This is the user that Apache (the web server) runs as on Debian based systems

$ crontab -u www-data -e

This will open an editor window. To run the cli cron script every 1 minute, add the line:

* * * * * /usr/bin/php  /path/to/moodle/admin/cli/cron.php >/dev/null

NOTE: the final >/dev/null sends all the output to the 'bin' and stops you getting an email every 1 minute.

Setting up cron on your system

Choose the information for your server type:

Here are some more instructions for specific hosts (please check that these are up to date):

Using third party cron service

Besides using cron hosted on your own server, you may use third party cron service (usually called webcron):

  • EasyCron - A webcron service provider that eliminates the need of crontab or other task schedulers to set cron job.
  • WebCron - A free and easy webcron service provider.

Cron settings in Moodle

An admin can set cron execution via command line only or a cron password for remote access in 'Site security settings' in the Site administration.

Remote cron

Using the 'web based' version of cron it is perfectly ok to place the cron process on a different machine to the Moodle server. For example, the cron service on a Unix server can invoke the cron web 'page' on a Windows-based Moodle server.

Scheduling tasks

An administrator can schedule cron tasks very precisely from Administration > Site administration > Server > Scheduled tasks, see Scheduled tasks

Running cron for several Moodle servers

  • Tasks can run in parallel and processes use locking to prevent tasks from running at the same time which allows cron to be triggered from multiple web servers that serve the same Moodle instance.
  • If you are running different Moodle instances on the same server, then each Moodle instance needs a cron job. (Even a single Apache web server can run different Moodle instances on different domains by using its virtual hosts capability https://httpd.apache.org/docs/2.2/vhosts/index.html.)

Debugging Scheduled Tasks

Sometimes, a particular cron task may not be working correctly. In Moodle versions before 2.7 - any cron task that was throwing exceptions would prevent the rest of cron from running. The only way to monitor if cron was completing each time, was to add some automated checking of the output of running cron (e.g. searching for the string "Cron completed at ").

In Moodle 2.7 and later, a single failing scheduled task will not prevent the remaining tasks from completing. When any single scheduled task fails, it is marked as a failure, and scheduled to be reattempted. If the task keeps failing, the next scheduled time will be backed off until it is attempted at most once every 24 hours. But checking the Scheduled tasks admin page, you can see if any task is currently failing (it will have a non-zero fail delay - which is the number of seconds to wait before reattempting a failed task). A simple way to debug a failing task, is to run it immediately using the cli scheduled task runner and monitor the output.

Logging and monitoring

Ideally you should also be logging the output of cron somewhere and monitoring it for issues. You can monitor the overall status of cron to make sure there are no errors by visiting:

Site administration / Reports / System status (/report/status/index.php)

You can also wire this status report up to tools like Icinga / Nagios using the Check API (https://docs.moodle.org/dev/Check_API) cli commands or with the help of plugins like https://github.com/catalyst/moodle-tool_heartbeat.

/admin/cli/checks.php

If there are errors then you can get more details for recently run tasks from the Logs column on the Scheduled task page, but this won't show ad hoc task failures:

Site administration / Server / Tasks / Scheduled tasks (/admin/tool/task/scheduledtasks.php)

To see ad hoc task failures you either need to rerun the task manually yourself and see the errors, or you need to have already collected the logs for review. For a Moodle running on a single box you could log to a simple log file, or for a cluster you might want to use syslogd or similar, e.g.:

 * * * * * /usr/bin/php  /path/to/moodle/admin/cli/cron.php 2>&1 | /usr/bin/logger ...

低遅延アドホックタスク

Each time cron is run, after the scheduled tasks the ad hoc tasks are also run. While scheduled tasks can run at most once a minute, ad hoc tasks can be queued at any moment, and generally you want them processed as soon as possible and to not have to wait for the scheduled task to run first. If you only run the normal admin/cli/cron.php then not only might it have to wait to process all the scheduled tasks first, if it has already finished you will have to wait until the next minute for cron to start again for it to be processed.

Instead you can run one or more dedicated ad hoc task processors which run in parallel to the main cron process.

 * * * * * /usr/bin/php  /path/to/moodle/admin/cli/adhoc_task.php --execute --keep-alive=59
 * * * * * /usr/bin/php  /path/to/moodle/admin/cli/adhoc_task.php --execute --keep-alive=59
...

Starting from Moodle 3.9 the—keep-alive option runs like a daemon so when the queue is empty rather than exiting it waits for new tasks to be queued so it can start processing as soon as possible.

Scaling up cron with multiple processes

As your site grows many of the scheduled tasks will take longer to complete, and also there will be more ad hoc tasks queued which need to be processed. The cron system is designed to work in parallel but each individual process can only process one task at a time so you must run multiple cron cli's. You can generally run a fairly high number of cron processes on a dedicated cron instance before needing to run multiple cron instances. To run more than one process simply spawn multiple cron processes each minute:

* * * * * /usr/bin/php  /path/to/moodle/admin/cli/cron.php
* * * * * /usr/bin/php  /path/to/moodle/admin/cli/cron.php
* * * * * /usr/bin/php  /path/to/moodle/admin/cli/cron.php
⋮
* * * * * /usr/bin/php  /path/to/moodle/admin/cli/adhoc_task.php --execute --keep-alive=59
* * * * * /usr/bin/php  /path/to/moodle/admin/cli/adhoc_task.php --execute --keep-alive=59
* * * * * /usr/bin/php  /path/to/moodle/admin/cli/adhoc_task.php --execute --keep-alive=59
⋮

It can be especially important to increase the number of adhoc_task.php processes as certain plugins and systems can generate very large numbers of ad hoc tasks, or tasks that can take a long time to process. Especially tasks like document conversions and automated backups can build up more quickly than they are processed if they are left on default settings.

By default only 3 scheduled tasks and 3 ad hoc tasks can be run concurrently so as you add more processes you need to increase the level of allowed concurrency:

Site administration > Server > Tasks > Task processing

Or in config.php:

$CFG->task_scheduled_concurrency_limit = 20; // Defaults to 3
$CFG->task_adhoc_concurrency_limit = 50; // Defaults to 3

Whatever you set these to make sure the server(s) hosting them can comfortably handle this many processes. Often the bottleneck will be a shared service, usually the database.

You may find that certain types of very long running tasks will consume all the available task processes which means no other tasks will run. e.g. if you have 5 cli processes, but in the task queue there are 20 ad hoc tasks for an automated backup, each of which will take ten minutes to complete, then very quickly all 5 processes will be consumed by backups and nothing else. Other small very fast and light tasks like a document conversion or forum emails will not get sent until the backups are complete and a process frees up. To manage this you can limit the concurrency of specific types of ad hoc tasks. A good rule of thumb is that if all of the 'heavy' tasks consume all of their own limits then you should still have another few processes standing by on idle waiting for anything else which may be added to the queue.

Automated backups are the worst known offender, so hypothetically if you are running 50 ad hoc task processes concurrently a reasonable restriction might be to cap the backups to consume no more than half of those processes, i.e. 25 at most:

In config.php:

$CFG->task_concurrency_limit = [
    'core\task\course_backup_task' => 25,
    'core_course\task\course_delete_modules' => 5,
];

See also

Forum discussions:

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

Cronでは、定期的なMoodleモジュールの実行を支援します。例えば、すべてのディスカッションフォーラムをチェックして、フォーラムをメール購読しているユーザに対して、新しい投稿のコピーをメール送信します。

すべての処理を実行するMoodleの主要なスクリプトは、adminディレクトリに置かれ、cron.phpと呼ばれます。スクリプト自体は自分で動作することができませんので、あなたはスクリプトを定期的 (例 5分または10分毎) に実行する仕組みを設定する必要があります。それぞれのモジュールで定義された機能をスクリプトが実行できるよう、Cronは「心臓の鼓動 (hearbeat)」を提供します。この種の定期的なメカニズムは「Cronサービス」として知られています。サービスは、ウェブホストの一部、または異なるサーバまたはコンピュータで実行することができます。

Cronの概要

スクリプトの概要

cron.phpスクリプトは、Moodleのモジュールに関する、Moodleデータベース内のmdl_modulesテーブル (デフォルトのテーブル接頭辞が mdl_ と仮定して) を調べて、定期的にcron機能が実行されるようにします。そして、それぞれのモジュールディレクトリ内にあるlib.phpファイルから「モジュール名_cron」の関数を探して、実行します。また、mdl_blockテーブルを調べて、cronメソッド (オブジェクト関数) が定期的に実行されるようにします。そして、それぞれのブロックから、そのブロックに関係する新しいオブジェクトのため、cronメソッドを実行します (プログラマーではない人のため、私は詳細説明を省略しています。プログラマーは、自分で admin/cron.phpを読めますから)。これらのファイル (lib.phpファイルおよびブロックのクラスが定義されているファイル) には、クリーンアップ機能、メール機能および定期的に実行する必要な機能を組み込むことができます。例えば、「管理 > コースバックアップ」で指定された時間にコースバックアップを作成するため、cronはシステムにトリガー (きっかけ) を与えます。また、cronはメッセージモジュールまたはフォーラム投稿通知に対してトリガーを与えますが、cronが実行されるたび、すべての機能がコールされるわけではありません。長期間ログインしていない学生の削除、古いログファイルの削除等、いくつかの機能は時々実行されるだけです。cron.phpファイルには、cron実行の1/5の割合で、これらのコアタスクをランダムに実行するためのセクションがあります。

Cronサービスロケーションおよびタイミング

cronを実行するコンピュータは、 Moodleが動作しているコンピュータと同じである必要はありません。例えば、あなたがcronを動作できないような、サービスを制限したウェブホスティングサービスを利用している場合、他のサーバまたはあなたの自宅のコンピュータでcronを実行させることができます。大切なことは、cron.phpが定期的に実行されることだけです。

このスクリプトのロードは、それほど高くありません。ですから、5分毎に動作させるのが適切です。あなたが5分毎のcron.phpの動作に心配な場合、15分毎または30分毎に動作間隔を延ばすこともできます。メール送信の遅れにより、コース内の活動をスローダウンしてしまうこともありますので、cron.phpの動作間隔を伸ばしすぎない方が良いでしょう。cron.phpによるメール送信は、「サイト管理 > セキュリティ > サイトポリシー」の「投稿を編集できる最大時間」に影響されることを記憶に留めてください。

Cronのテストおよびマニュアルトリガー

あなたのブラウザから直接スクリプトが動作できるか、最初にテストしてください: http://example.com/moodle/admin/cron.php

あなたのMoodleにログインしているユーザから、コマンドラインでcronが実行された場合、cronを実行するため、一時的に管理者環境が作成され、そのユーザはログアウトされます。cron.phpファイルを無効にすることで、コマンドラインによるcron.php実行を停止することができます。

cron.phpを無効にした場合、自動的かつ定期的にcron.phpが実行される環境を設定する必要があります。

WindowsシステムのCron管理

WindowsシステムでMoodleのcron.phpを設定するには、異なる2つの方法があります:

  • Moodle Cronパッケージを使用する 最も簡単な方法は、Moodleに関するWindowsサービスをインストールしてくれる、この小さなパッケージ「MoodleCron-Setup.exe」を使用することです。このパッケージを実行した後は、すべて忘れましょう!
  • スケジュールタスクを使用する あなたがWindowsスケジューラを使用したい場合、またはmoodle-cron-for-windowsパッケージに問題がある場合、スケジュールタスクを設定することで、Windows用のwgetを使用するか、コマンドラインでphpを使用することができます。以下の手順に従ってください:
    • php.exe/php-win.exe (コマンドラインバイナリ) または wget を選択する。
あなたのphpフォルダ (例. c:\php) にインストールされているphp.exeまたはphp-win.exeバイナリ (PHP version 5以降) は、cronスクリプトの動作に対して良いパフォーマンスをもたらします。
あなたがwgetを使用したい場合、Windows用wgetのコンパイル済みバージョンを、オリジナルのGNU Win32 ports (http://unxutils.sourceforge.net/)、Heiko Herold's windows wget spot (http://xoomer.virgilio.it/hherold/) または Bart Puype氏のWGET for Windows (win32) ページ (http://users.ugent.be/~bpuype/wget/) からダウンロードしてください。あなたがHeiko Herold氏のパッケージを使用している場合、すべてのDLLファイルを「C:\Windows\system32」ディレクトリにコピーしてください。そして、wget.exeファイルを「c:\windows」ディレクトリにコピーしてください (このことにより、wgetを常にサーチパスに置きます)。
  • Scheduled Task を設定する。
- 「スタート >> コントロールパネル >> タスク >> コントロールされたタスクの追加」へ移動してください。
- ウィザードを開始するには、「次へ (N) >」をクリックしてください。
- 「参照 (R) ...」ボタンをクリックして、 c:\php\php.exe または c:\windows\wget.exe を選択した後、「開く (O)」をクリックしてください。
- タスク名に「Moodle Cron」と入力して、タスクの実行に「日単位 (D)」を選択した後、「次へ (N) > 」をクリックしてください。
- 開始時刻で「12:00」を選択して、このタスクの実行に「毎日 (A)」を選択してください。開始日に今日の日付を選択した後、「次へ (N) > 」をクリックしてください。
- タスクを実行するユーザ名およびパスワードを入力してください (管理者権限を持つアカウントである必要はありません)。パスワードを正しく入力したことを確認して、「次へ (N) > 」をクリックしてください。
- 「[完了]をクリックしたときに詳細プロパティを開く (A)」をチェックして、「完了」ボタンをクリックしてください。
- 「スタート >> ファイル名を指定して実行 (R) ...」を選択した後、テキストボックスに次のコマンドを入力してください:
c:\windows\wget.exe -q -O NUL http://my.moodle.site/moodle/admin/cron.php
または
c:\php\php-win.exe -f c:\moodle\admin\cron.php
あなたのMoodleディレクトリと「c:\moodle」を入れ替えるか、あなたのサイト名「my.moode.site」を入力してください。

- 「スケジュール」タブをクリックして、「詳細設定 (V) ...」ボタンをクリックしてください。
- 「タスクを繰り返し実行 (R)」チェックボックスをチェックして、「間隔 (V)」に5分、「継続期間 (D)」に23時間59分を設定してください。
- 「OK」ボタンを2回クリックして、完了です。
  • あなたのスケジュールタスクをテストする 登録したタスクにマウスポインタを合わせて右クリック、「タスクの実行 (U)」をクリックすることで、あなたはスケジュールタスクが正常に動作するかどうか確認することができます。すべてが正常にセットアップされている場合、wget/php実行中、一時的にDOSウィンドウが表示された後、消えます。タスクフォルダをリフレッシュすることで、現在の時間を反映した「前回の実行時間」 (詳細 (D) フォルダ表示) が表示され、「前回の結果」カラムには「0x0」 (すべてOK) が表示されます。どちらかの表示が異なる場合、あなたのセットアップ内容を再度確認してください。
  • cronアウトプットを記録する cronジョブがエラーを出している場合、バックアップが完了しない場合、ユーザのフォーラム購読メールが遅延する場合、cronスクリプトの実行時のアウトプットを記録してください。cronアウトプットを記録するためには、コマンドがphp.exeを使用し、アウトプットがファイル (例 c:\moodle\admin\cron.log) に記録されるよう合わせてください。以下、php.exeコマンドの例です:
c:\php\php.exe -f c:\moodle\admin\cron.php > c:\moodle\admin\cron.log

ウェブホスティングサービスのCron管理

ウェブホスティングでは、多くの場合、ウェブベースのコントロールパネルでcronサービスを設定することができます。

CPanelのCronサービス

あなたがcPanelを使用している場合、ログイン後、ページ下部の「Advanced」を確認してください。そして、「Cron Jobs -> Advanced (Unix style)」をクリックします。 cronが30分ごとに動作するよう、以下の内容を入力してください。

Email address for output: emailaddress@mydomain.con
Minute:*/30
Hour:*
Day:*
Month:*
Weekday:* 
Command: wget -q -O /dev/null http://www.mydomain.com/moodle/admin/cron.php

「Commit Changes」をクリックしてください。あなたのメールに送信されるcronの動作状況を確認してください。 Cpanel-cron-setup.JPG

他のシステムのCronサービス

他のシステムでは、「Cron jobs」のようなボタンを探してください。そこでは、以下のUnixコマンドと同じようなコマンドを設定することができます。


あなたにサーバでwgetコマンドを実行するパーミッションがない場合、このphpコマンドを使用することができます:

/usr/local/bin/php -q /real/path/to/script/admin/cron.php

例えば:

/usr/local/bin/php -q /home/username/public_html/moodle/admin/cron.php

あなたのMoodleフォルダへの実パスが分からない場合、PHPの「realpath() 関数」を使用することができます。

もうひとつの方法、あなたにサーバでwgetコマンドを実行するパーミッションがない場合、curlコマンドを使用することができます。

Note:moodle 2.0以降、コマンドラインで実行するcron.phpのパスが変更されました。コマンドラインで実行する場合のパスは/admin/cli/cron.phpとなります。

例えば:

curl --silent --compressed http://mydomain.com/moodle/admin/cron.php

UnixのコマンドラインでCronを使用する

あなたがコマンドラインからページをコールするため、異なるコマンドラインプログラムがあります。サーバにより、実行できないプログラムもあります。

例えば、あなたは「wget」のようなUnixユーティリティを使用することができます:

wget -q -O /dev/null http://example.com/moodle/admin/cron.php

この例では、アウトプットは (/dev/null に) 破棄されます。

多くのMoodleユーザにより、「wget」が時々動作不良を起こすと報告されています。特にフォーラムから毎日メール要約がすべてのユーザに送信されない場合、代わりのコマンドで問題を解決することができます。

php http://example.com/moodle/admin/cron.php

同じくlynxを使用すると:

lynx -dump http://example.com/moodle/admin/cron.php > /dev/null

この例では、アウトプットは (/dev/null に) 破棄されます。

代わりにコマンドラインで実行するようコンパイルされた、スタンドアロンバージョンのPHPを使用することもできます。このPHPを使用するメリットは、あなたのウェブサーバのログがcron.phpの連続したリクエストで一杯にならないことです。このPHPを使用するデメリットは、コマンドラインバージョンのPHPにアクセスしなければならないことです。

/opt/bin/php /web/moodle/admin/cron.php

Unixのcrontabプログラムを使用する

Cpanelでは、crontabとして知れられているUnixユーティリティのウェブインターフェースを提供します。あなたがコマンドラインを使用できる場合、コマンドを使用して、自分でcrontabを設定することができます。

crontab -e

そして、前述「Cron Jobs -> Advanced (Unix style)」の内容を次のように追加します:

*/30 * * * * wget -q -O /dev/null http://www.mydomain.com/moodle/admin/cron.php

最初の5つのエントリは、それに続くコマンドを実行するための時間の値です。アスタリスク (*) は、常時を意味するワイルドカードです。上記例では、コマンド「wget -q -O /dev/null...」を30分毎 (*/30)、毎時 (*)、毎日 (*)、毎月 (*)、すべての曜日 (*) に実行します。

「-O」の「O」は、ゼロではなく、アウトプット先を示す大文字のO (オー) です。この例の場合、アウトプットを破棄するブラックホール「dev/null」をアウトプット先としています。あなたがcron.phpのアウトプットを表示したい場合、ブラウザにURIを直接入力してください。

あなたが「初心者」の場合、「EDITOR=nano crontab -e」コマンドにより、nanoエディタを使用して、crontabを編集することができます。Ubuntuでは、nanoエディタをデフォルトのエディタとしています。

通常、「crontab -e」コマンドでは、viエディタが起動されます。「i」キーを押すことで、挿入モードに入ります。前述のコマンドラインを入力して、ESCキーを押すことで、挿入モードから抜けます。「wq」とタイプすることで、あなたは内容を保存して、viエディタを終了させることができます。または、「q!」とタイプすることで、内容を保存せずに、viエディタを終了させることができます。viエディタに関するイントロダクション (英語) は、こちらをご覧ください

関連情報

Using Moodleフォーラムディスカッション (英語):