クローン操作の実行時権限は何ですか?

クローン操作の実行時権限は何ですか?

クローンジョブはどの権限で実行されたときに何をしますか?

私はこれについてよくわかりません。これを追加したユーザーと同じ権限がありますかcrontab -e

ベストアンサー1

次のように、システムcrontabエントリでユーザーを指定できます。

# For details see man 4 crontabs

# Example of job definition:
.---------------- minute (0 - 59)
|  .------------- hour (0 - 23)
|  |  .---------- day of month (1 - 31)
|  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
|  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
|  |  |  |  |
*  *  *  *  * user-name  command to be executed

6番目のパラメーターはユーザー名にすることができます。また、/etc/cron.dこのディレクトリにスクリプトを配置することもできます。これらのスクリプトは上記のcrontabエントリと同じ形式を取ります。たとえば、次のようになります。

# /etc/cron.d/clamav-update
## Adjust this line...
MAILTO=root

## It is ok to execute it as root; freshclam drops privileges and becomes
## user 'clamav' as soon as possible
0  */3 * * * root /usr/share/clamav/freshclam-sleep

次のディレクトリにスクリプトを配置できますが、rootとして実行する必要があります。

  • デイリープランナー
  • 1時間に1回
  • 週間計画
  • 月額プラン

最後に、特定のユーザーに対して次のコマンドを実行して、ユーザーベースのcrontabエントリを作成できます。

$ crontab -e

これらのエントリは、このディレクトリのユーザーと同じ名前のファイルに保存されます/var/spool/cron/

$ sudo ls -l /var/spool/cron/
-rw------- 1 saml root 0 Jun  6 06:43 saml

おすすめ記事