0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Linux] ジョブスケジューリング_cron, at, systemdのTimerUnit

Last updated at Posted at 2025-06-11

cronコマンド

ディレクトリ/ファイル 由来 システム 説明
/etc/cron.allow allow list for cron cron - crontab コマンドを使ったジョブ登録を許可するユーザーを列挙するファイル
- 存在する場合、/etc/cron.deny は無視される
/etc/cron.deny deny list for cron cron - crontab コマンドを禁止するユーザーを列挙するファイル
- /etc/cron.allow が存在しないときのみ有効
/etc/crontab cron table cron - システム全体の cron ジョブを定義する設定ファイル
- ユーザー指定フィールドを含む
/etc/cron.hourly/ hourly job directory cron - 毎時実行されるスクリプトを配置するディレクトリ
/etc/cron.daily/ daily job directory cron - 毎日実行されるスクリプトを配置するディレクトリ
/etc/cron.weekly/ weekly job directory cron - 毎週実行されるスクリプトを配置するディレクトリ
/etc/cron.monthly/ monthly job directory cron - 毎月実行されるスクリプトを配置するディレクトリ
/etc/cron.d/ cron directories cron - 個別の cron 設定ファイルを配置するディレクトリ
- /etc/crontab と同様の形式(ユーザーフィールドあり)

atコマンド

ディレクトリ/ファイル 由来 システム 説明
/etc/at.allow allow list for at at - atコマンドによるジョブ登録を許可するユーザーを列挙するファイル
- 存在する場合、/etc/at.denyは無視される
/etc/at.deny deny list for at at - atコマンドを禁止するユーザーを列挙するファイル
- /etc/at.allowが存在しないときのみ有効

systemdのTimerUnit

ディレクトリ/ファイル 由来 システム 説明
/etc/systemd/system system daemon system-specific configuration systemd 編集可

- システムのユニット設定ファイル
- /lib/systemd/systemを上書き
/etc/systemd/system/default.target default target systemd システム起動時に読み込まれるデフォルトターゲットを指すシンボリックリンク

- 変更: ln -s /lib/systemd/system/graphical.target /etc/systemd/system/default.target
- 変更: systemctl set-default
/etc/systemd/system/*.timer timer unit systemd Timer Unitの定義ファイル

- .serviceファイルと対になる
- cronの代替として使える
- 設定例: OnCalendar=daily
- 実行例: systemctl enable backup.timer

Ping-t

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?