34
39

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOSでcronを動かす手順のまとめ

Last updated at Posted at 2014-06-13

以下サイトを参考にcronがインストールされていない場合はインストールする
http://d.hatena.ne.jp/momiage3dau/20081204/1228388516

cronを起動する

sudo /etc/init.d/crond start

crontabを編集する

sudo crontab -e

試しに毎分現在時刻をログに書き出す設定を書いてみる

*/1 * * * * echo `date +"\%Y/\%m/\%d \%H:\%M:\%S"` >> /tmp/cron.log

これでログに現在時刻が書かれていれば正常にcronが動いている

自分の開発環境でcron設定を確認するのに、使えますね

34
39
4

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
34
39

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?