top of page

การใช้งาน crontab Set Auto Restart บน ubuntu

  • Writer: anusit.p38
    anusit.p38
  • Dec 17, 2018
  • 1 min read

หลังจากการเปิดไฟล์ crontab จากโพส การใช้งาน crontab บน ubuntu เบื้องต้น ให้ set คำสั่ง restart

ซึ่งจะใช้คำสั่ง shutdown -r หลังจากรันแล้วจะถามหา password ของ user

ตัวอย่างคำสั่งการ Restart

$ sudo -S shutdown -r now

ถ้าไม่ต้องการถามหา password ให้ระบุ password ไปด้วย

$ echo 123456 | sudo -S shutdown -r now

auto restart

ตัวอย่างดังภาพคือการ Set Reboot ทุกๆ 8โมงเช้าของทุกวัน

แหล่งที่มา : https://askubuntu.com/questions/13730/how-can-i-schedule-a-nightly-reboot

Yorumlar


Recent Posts
Archive
Search By Tags
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
bottom of page