LoginSignup
25
20

More than 5 years have passed since last update.

Crontabのバックアップとリストア

Last updated at Posted at 2016-03-04

環境移設の際にCronの設定も移すことがあると思う。
たまにしかやらないので、引っ越し方法を忘れることがあったのでメモ

  • crontabのバックアップ
crontab -l > crontab.back
  • crontabのリストア
crontab crontab.back

これだけ、ただ、ユーザごとにCrontabがあることも多いと思うので、そのあたりは一工夫要ると思う
※面倒だったら/var/spool/cron/(ユーザ名)に各ユーザのcrontabの実体があるので、これをコピーする
※mailtoで飛び先を指定している場合は/etc/aliasesの確認も忘れない

25
20
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
25
20