• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Crontab & Reboot

C

comptech520

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

If so, how?

Thanks
 
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?
 
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
 
Back
Top