Linux環境設定/一般ユーザ権限でOS起動時にバックグラウンド実行させる・crontab
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#navi(../)
* 管理者権限ではなく一般ユーザ権限でOS起動と同時にバック...
本資料はcrontabの設定などについて記したものです。
#contents
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)
* 一般的なOS起動時のプログラム自動実行 [#v606f7d5]
Linuxでは、OSの起動と同時に実行させたいプログラムは、/etc...
自動起動スクリプトや設定ファイルを置いて管理します。
このディレクトリ内におかれたファイルを参照して、システム...
システムの管理と提供するサービスに必要なデーモンプログラ...
しかし、これはシステムワイドで利用するデーモンプログラム...
個別のユーザが彼自身の権限で実行したいプログラム(fetchma...
管理者権限で自動起動スクリプトを用意して、内部で''su''や'...
* cronを使ってのOS起動時のプログラム自動実行 [#bdeabbdc]
マシンの起動と同時に一般ユーザ権限でプログラムを実行する...
cronはLinuxで使われる基本的なプログラムスケジューラであり...
分単位の任意の時刻をして定期的にプログラムをバックグラウ...
このcronの機能の中には、時刻指定ではなくOSの起動時を指定...
通常のcrontabの設定で、
''分'' ''時'' ''日'' ''月'' ''週''
の5つの値を設定する箇所にその代わりに、
''@reboot''
という設定句を設定することで、OSの起動時にプログラムを起...
設定例を、crontab -l で表示したものが以下になります。
% crontab -l -u user
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be...
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for ...
# Notice that tasks will be started based on the cron's ...
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent ...
# email to the user the crontab file belongs to (unless ...
#
# For example, you can run a backup of all your user acc...
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5...
#
# m h dom mon dow command
@reboot /home/user/bin/user.sh
この設定により、OS起動のタイミングで一般ユーザであるuser...
この方法であれば、自動実行スクリプトや設定ファイルの作成...
その設置に管理者権限が必要になることもありません。
以上、管理者権限ではなく、一般ユーザ権限をOS起動と同時に...
#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)
終了行:
#navi(../)
* 管理者権限ではなく一般ユーザ権限でOS起動と同時にバック...
本資料はcrontabの設定などについて記したものです。
#contents
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)
* 一般的なOS起動時のプログラム自動実行 [#v606f7d5]
Linuxでは、OSの起動と同時に実行させたいプログラムは、/etc...
自動起動スクリプトや設定ファイルを置いて管理します。
このディレクトリ内におかれたファイルを参照して、システム...
システムの管理と提供するサービスに必要なデーモンプログラ...
しかし、これはシステムワイドで利用するデーモンプログラム...
個別のユーザが彼自身の権限で実行したいプログラム(fetchma...
管理者権限で自動起動スクリプトを用意して、内部で''su''や'...
* cronを使ってのOS起動時のプログラム自動実行 [#bdeabbdc]
マシンの起動と同時に一般ユーザ権限でプログラムを実行する...
cronはLinuxで使われる基本的なプログラムスケジューラであり...
分単位の任意の時刻をして定期的にプログラムをバックグラウ...
このcronの機能の中には、時刻指定ではなくOSの起動時を指定...
通常のcrontabの設定で、
''分'' ''時'' ''日'' ''月'' ''週''
の5つの値を設定する箇所にその代わりに、
''@reboot''
という設定句を設定することで、OSの起動時にプログラムを起...
設定例を、crontab -l で表示したものが以下になります。
% crontab -l -u user
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be...
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for ...
# Notice that tasks will be started based on the cron's ...
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent ...
# email to the user the crontab file belongs to (unless ...
#
# For example, you can run a backup of all your user acc...
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5...
#
# m h dom mon dow command
@reboot /home/user/bin/user.sh
この設定により、OS起動のタイミングで一般ユーザであるuser...
この方法であれば、自動実行スクリプトや設定ファイルの作成...
その設置に管理者権限が必要になることもありません。
以上、管理者権限ではなく、一般ユーザ権限をOS起動と同時に...
#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)
ページ名: