These are VPS scripts scheduled in cron on the host server:
*/5 * * * * /hsphere/shared/scripts/cron/vps-cron.pl >/dev/null 2>&1
59 */1 * * * /hsphere/shared/scripts/cron/vps-cron-traf.pl >/dev/null 2>&1
*/4 * * * * /hsphere/shared/scripts/cron/vps-cron-delete.pl >/dev/null 2>&1
*/3 * * * * /hsphere/shared/scripts/cron/vps-cron-fix.pl >/dev/null 2>&1
The $VPSSCRIPTS/cron/vps-cron.pl script (Default: /hsphere/shared/scripts/cron/vps-cron.pl) runs every 5 minutes. It is used to install and configure new Virtual Private Servers.
The script works as follows:
$HSVPSFILES/VPS_NAME/VPS_NAME.in file (Default: .../cp/VPS_NAME/VPS_NAME.in).$HSVPSFILES/VPS_NAME/VPS_NAME.out file (Default: .../cp/VPS_NAME/VPS_NAME.out)$HSVPSFILES/VPS_NAME/VPS_NAME.done (Default: .../cp/VPS_NAME/VPS_NAME.done), and deletes the request file: $HSVPSFILES/VPS_NAME/VPS_NAME.in (Default: .../cp/VPS_NAME/VPS_NAME.in).$STATCRONPID (Default: /var/log/hsphere/vps_cron.pid) with its own PID, to prevent executing another copy of it. $VPSCONFIGS/VPS_NAME.conf (Default: /hsphere/local/config/vserver/VPS_NAME.conf) $VPSCONFIGS/VPS_NAME.sh (Default: /hsphere/local/config/vserver/VPS_NAME.sh)It installs basic Linux RH7.3 packages and additional packages if configured, creates services, set limits, assigns IPs, and finally, starts VPS.Processes VPS network traffic statistics. Creates files with VPS daily traffic statistics: /hsphere/local/var/statistic/DD.MM.YYYY.vps.txt
This cron script that runs every 4 minutes deletes VPS server(s) scheduled for removing.
VPS server is scheduled for removing if it cannot be deleted immediately after the removing request was sent, e.g. when other tasks need to be finished first.
Names of the VPS servers(s) scheduled for removing are listed delimited with whitespace in the DELETE parameter of the /hsphere/local/config/vserver/vps.list configuration file.
Example:
# cat /hsphere/local/config/vserver/vps.list
DELETE="vps1.psoft vps2.psoft"
VDU=""
VSERVERS="3:230.psoft 4:vps1.psoft 5:test.test 6:vps2.psoft 7:vps4.psoft 8:vps5.psoft 9:vps6.psoft
10:vps3.psoft 11:vps7.psoft 12:vps9.psoft
13:blabla.test.tst 14:vps11.psoft 15:vps12.psoft 16:vps13.psoft 17:vps-rh73-blank.psoft
18:vps14.psoft 21:newacc.test.tst
22:jumbo.jumbo23:vps200.hs.test 24:vps203.hs.test 25:vps207.hs.test 26:vps212.hs.test 27:myvps.test
28:my-server.test 29:krambambuli.test"
This script fixes some VPS(s) configuration: limits, usage, etc.
For instance, it can fix VPS server(s) configuration that was "lost" when you upgraded the FreeVPS kernel after the host system (physical box) reboot.
Fixed parameters:
The script runs as a cron job and is configured to fix corrupted configuration every 3 minutes. The script also checks and fixes VPS servers(s) daily.
If needed, you can run the script manually. Use --vps to fix a particular VPS and -f|--force to forcefully fix a virtual server(s) even if its(their) configuration is uncorrupted.
IMPORTANT: It is recommended that you stop/suspend VPS server(s) before the fix.
For help, run:
# vps-cron-fix.pl --help
vps-cron-fix.pl # Script for checking and fixing VPS(s) configuration: limits, usage, etc.
# The script is configured to check (and to fix if needed) VPS(s) configuration every 3 minutes (run as a cron job).
# VPS(s) are fixed daily anyway.
Usage:
vps-cron-fix.pl [--vps=<name>|-v <name>] [--force|-f]
-v|--vps # Fixes particular VPS.
# If not set - script will fix all known VPS servers.
-f|--force # Run script by force (even if it was run today already).
--help # Print this help information.
Location: $VPSSCRIPTS/cron/vps-cron-net-reconfig.pl (by default /hsphere/shared/scripts/cron/vps-cron-net-reconfig.pl)
This script runs every 5 minutes as cron to reconfigure virtual servers' network. If subnet configuration is changed, it reconfigures all affected virtual servers' configuration. If subnet default gateway or mask is changed, it reconfigures and restarts network for each virtual server. If network interface is changed on a virtual server, it restarts this virtual server.
Usage:
vps-cron-net-reconfig.pl [--vps=<name>] [--force]
--vps # Process particular VPS.
# If not set - script will process all registered virtual servers.
--force # Run script by force --help # Print this help information.
Examples:
vps-cron-net-reconfig.pl --vps=vps.test --force
# Process VPS server vps.test forcefully, even if the reconfig flag is not set
vps-cron-net-reconfig.pl --vps=vps.test
# Process VPS server vps.test if the reconfig flag is set
vps-cron-net-reconfig.pl --force
# Process all registered virtual servers, even if reconfigure flag is not set
vps-cron-net-reconfig.pl
# Process all registered VPS server(s) if the reconfig flag is set