• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Setup a cron job script to restart Plesk / Virtuozzo?

Justin Clarke

Regular Pleskian
This article (http://kb.odin.com/en/118) shows you how to restart Plesk:

~# /etc/init.d/psa stop
~# /etc/init.d/psa start

What I'm really after is the command that is behind the "Restart VPS" button function on the Virtuozzo Panel? Or does this do the same thing?

Can these commands be me made into a cron job? Or won't this work as on the stop command cron will stop?

Any info would be great. Thanks.
 
I think I found the command to do a Virtuozzo restart. It's "vzctl restart <CT_ID>" (see here).

I need a container ID to append to the command. When I do a manual "Restart VPS" from the button in the Virtuozzo Panel the details show as:

Start Process Completed
Fri Aug 6 23:54:40 2010 Click here to open/close operation details.Restart VPS #55136336 Completed
Fri Aug 6 23:54:40 2010 Operation restart with the VPS(s) VEID55136336 is started.
Fri Aug 6 23:54:40 2010 Stopping VE ...
Fri Aug 6 23:54:58 2010 VE was stopped
Fri Aug 6 23:54:58 2010 VE is unmounted
Fri Aug 6 23:54:58 2010 Starting VE ...
Fri Aug 6 23:54:58 2010 VE is mounted
Fri Aug 6 23:54:58 2010 Setting devperms 20002 dev 0x7f00
Fri Aug 6 23:54:58 2010 Setting devperms 20007 dev 0xac8
Fri Aug 6 23:54:58 2010 Adding port redirection to VE(1): 1234 5678
Fri Aug 6 23:54:58 2010 Adding IP address(es): 111.11.222.222
Fri Aug 6 23:54:59 2010 Hostname for VE set: 123.server-server.info
Fri Aug 6 23:54:59 2010 File resolv.conf was modified
Fri Aug 6 23:54:59 2010 Configure meminfo: 262144
Fri Aug 6 23:54:59 2010 Setting devperms 60010 dev 0xf6
Fri Aug 6 23:54:59 2010 VE start in progress...
Fri Aug 6 23:54:59 2010 Operation restart with the VPS(s) VEID55136336 is finished successfully.
Fri Aug 6 23:54:59 2010 Complete Process Completed

So is 55136336 my container ID? So if I run a "vzctl restart 55136336" that will do the same job as clicking the "Restart VPS" from the button in the Virtuozzo Panel?

Or should I just use a "shutdown -r now" command??

Thank you.
 
Last edited:
Yes, "Restart VPS" is the same that 'vzctl restart VPS_ID'.
 
Thanks.

So would that command work running from a cron job? Or would it stop the cron job before it's finished running the command?
 
vzctl command can be started only from Virtuozzo hardware node but not from VPS.
 
Back
Top