1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Crontab & Reboot

Discussion in 'Plesk for Linux - 8.x and Older' started by comptech520, Jun 7, 2006.

  1. comptech520

    comptech520 Guest

    0
     
    Is there a way I can set up in the server crontab to reboot the server maybe every 2 weeks?

    If so, how?

    Thanks
     
  2. jhobbs721

    jhobbs721 Guest

    0
     
    What you're looking to do is execute the reboot command, In this example, we'll assume it's /usr/bin/reboot.

    With CRON, there a 5 fields you can use to specify WHEN the command should be executed. The entry looks like this:

    # # # # # <command>

    An explanation of each field is below:

    1 - A minute, expressed as a number from 0 through 59.
    2 - An hour, expressed as a number from 0 through 23.
    3 - A day of the month, expressed as a number from 1 through 31.
    4 - A month of the year, expressed as a number from 1 through 12.
    5 - A day of the week, expressed as a number from 0 through 6 (with 0 standing for Sunday).

    So in your example, let's say we want to reboot at midnight on the 1st adn 15th of each month... The command would look like this:

    0 0 1,15 * * /usr/bin/reboot -f

    As you can see, we're setting the minute and hour fields to 0, which equates to midnight. The 'day of month' field is set to 1,15, which means the 1st and 15th of the month. The last two fields are set to *, which tell cron to match anything... CRON will only fire when ALL 5 fields are matched.

    Make sense?
     
  3. comptech520

    comptech520 Guest

    0
     
    so basically, using fedora core 2 and plesk

    in the server area of plesk I choose crontab

    and use this as the command?

    /usr/bin/reboot

    thanks
     
Loading...