Last active
December 18, 2015 03:45
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL=/bin/bash | |
PATH=/sbin:/bin:/usr/sbin:/usr/bin | |
MAILTO=root | |
HOME=/ | |
01 * * * * root run-parts /etc/cron.hourly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 時刻合わせ | |
0 * * * * /usr/sbin/ntpdate -bs ntp1.noah.idc.jp > /dev/null 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 分 時 日 月 曜日 実行ユーザ 実行コマンド | |
# 毎時15分に、「logger」コマンドで「/var/log/messages」にをログを書き出す設定 | |
15 * * * * root logger crontab-test | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 時刻合わせ | |
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