LoginSignup
3
3

More than 5 years have passed since last update.

定期的にサーバを再起動 (例:毎月第1日曜日の午前2時)

Posted at

再起動スクリプト

/usr/local/bin/reboot.sh



! /bin/sh

reboot

権限設定


# chmod 755 /usr/local/bin/reboot.sh

crontabの設定

rootで設定


# crontab -e

#1日~7日までの日曜日(%w=0)の2時に実行:第一日曜日午前二時に再起動実行
0 2 1-7 * * test $(date +\%w) -eq 0 && /usr/local/bin/reboot.sh
3
3
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
3
3