LoginSignup
48

More than 5 years have passed since last update.

posted at

updated at

Organization

安全なcrontab修正手順

例の如く上司に教わった安全な作業手順。
作業ディレクトリ作成&移動

mkdir -p ./`date '+%Y%m%d'`/crontab/
cd ./`date '+%Y%m%d'`/crontab/

現在のcrontabの設定のバックアップを作成。同時に編集用ファイルを作成。

crontab -l > crontab.org
crontab -l > crontab.edit

編集&現状の設定とdiffをとる

vi crontab.edit
crontab -l | diff crontab.edit -

適用&確認

crontab crontab.edit
crontab -l

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
What you can do with signing up
48