• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

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