Forum Discussion

kridsana's avatar
kridsana
Icon for Cirrocumulus rankCirrocumulus
Feb 04, 2013

Crontab and reboot command?

Hi everybody

 

I've to make BIG-IP to reboot every month so i want to make schedule from crontab

 

but i struck with command that to make BIG-IP reboot ? (just "00 00 1 * * reboot" doesn't work)

 

how to do this job?

 

thank you for advance

 

 

8 Replies

  • OK. You should be using crontab -e while logged in as a user with the necessary privileges when setting up the job. Try 'shutdown -r now' instead of reboot.
  • OK. You should be using crontab -e while logged in as a user with the necessary privileges when setting up the job. Try 'shutdown -r now' instead of reboot.

     

    I try "15 15 * * * shutdown -r now" and nothing happen . so I try to use "20 15 * * * /sbin/shutdown -r now" this is work. (I also try "20 15 * * * /usr/bin/full_box_reboot" but this doesn't work so I think it's problem of shell type or else , have any suggestion?)

     

    Thank you for suggestion.
  • OK. You should be using crontab -e while logged in as a user with the necessary privileges when setting up the job. Try 'shutdown -r now' instead of reboot.

     

    I try "15 15 * * * shutdown -r now" and nothing happen . so I try to use "20 15 * * * /sbin/shutdown -r now" this is work. (I also try "2215 * * * /usr/bin/full_box_reboot" but this doesn't work so I think it's problem of shell type or else , have any suggestion?)

     

    Thank you for suggestion.
  • Another question is how to delete post (that's flushed) T-T

     

  • /sbin/shutdown -r now should be fine, it's not too surprising a path is required. For a cron reference: http://www.adminschoice.com/crontab-quick-reference (regarding the timing)

     

    No idea how to delete a post I'm afraid. =]

     

  • Problem happen again this seem like known issue. (repeatly reboot)

     

     

    First is I test crontab and seem this work fine , so i used it with another BIG-IP (VM) with NTP set up and result is cron does reboot everytime after boot finished T-T

     

    then I delete NTP from configuration and everything work fine (no repeatly reboot) . ps I used BIG-IP VM ver 11.3.0 provisioned LTM, GTM , AFM , ASM

     

     

    this doesn't make sense . Problem happen when BIG-IP have NTP configuration -_- ?

     

    can you test this and check result ?

     

    thank you
  • See this article for some information on NTP and the host configuration: http://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ve-vmware-esx-esxi-11-3-0/5.html?sr=27098029

     

     

    Perhaps this is the cause of the issue?
  • Jnon's avatar
    Jnon
    Icon for Nimbostratus rankNimbostratus
    you should always use a absolute path in the cron for sure,

     

    can you try typing

     

    which full_box_reboot

     

    to get the path of full box reboot.

     

     

    Curious why your doing a monthly reboot? I've never seen these things have that kind of issue.

     

     

    Also, are you running in a HA pair, are you interested in doing a config sync before you reboot your primary, unit to make sure the standby has the current config, I also would recommend creating a little shell script that would do a b verify load first - to make sure you have a valid config file before you reboot.