Skip to content

Instantly share code, notes, and snippets.

@azusanakano
Last active December 18, 2015 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azusanakano/a3c90649af262da4e8e4 to your computer and use it in GitHub Desktop.
Save azusanakano/a3c90649af262da4e8e4 to your computer and use it in GitHub Desktop.
crontabの書き方とcrontabでのサーバ時刻合わせ設定 (AWS EC2 - Amazon Linux -- NTP) ref: http://qiita.com/azusanakano/items/4448bf805f006acda907
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
01 * * * * root run-parts /etc/cron.hourly
# 時刻合わせ
0 * * * * /usr/sbin/ntpdate -bs ntp1.noah.idc.jp > /dev/null 2>&1
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
# 分 時 日 月 曜日 実行ユーザ 実行コマンド
# 毎時15分に、「logger」コマンドで「/var/log/messages」にをログを書き出す設定
15 * * * * root logger crontab-test
# 時刻合わせ
0 * * * * /usr/sbin/ntpdate -bs ntp1.noah.idc.jp > /dev/null 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment