LoginSignup
2
1

More than 5 years have passed since last update.

crontab の消失にそなえる

Posted at

私は何年ものあいだ恐怖とともに crontab を編集してきた。

crontab は -r オプションで削除される。-e で編集になるが r は e のとなりにあるのでいつも内容の消失におびえてキーボードをたたいた。

いろいろな対策があるが私はこの方法をとる。

35 * * * * crontab -l > ~/crontab-backup/`hostname`.`date +\%Y-\%m-\%d-\%H-\%M`.crontab

バックアップだ。バックアップしよう。バックアップしよう。バックアップしよう。
ホスト名と時間があるので、いつか困ったときに約にたつかもしれない。

2
1
1

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
2
1