![]() ![]() ![]() ![]() |
This chapter provides information on using Command Line Interface scripts.
Topics include:
Command Line Interface scripts are advanced features for which limited Customer Support is available. The syntax of these commands may change in future releases of Ensim Pro.
Some of the commands in this chapter include the shell primitive \ which is used to enter a new line, without the shell executing the command. This is included for reasons of clarity and can be omitted if your command fits in one line.
Ensim offers Command Line Interface scripts for automating some of the tasks you perform as an ISP or Appliance Administrator. Most of these scripts reside in the directory /usr/local/bin and some in /usr/sbin. Use any Telnet or SSH client to access the server running Ensim Pro and execute these scripts.
The command line is composed of PERL programs and modules. The arguments for a script are passed in an encoded format by the interface to avoid security problems with special shell escapes. As a rule the interface fills in defaults and the command line tool checks all the arguments it receives.
The error messages go to STDERR and the output goes to STDOUT. If the command fails, it exits with code 1. If there are error messages on STDERR and the exit code is 0, it means that the operation succeeded, but some problems were encountered.
Functions that add information try to delete all the changes they made if an error occurs (so they either totally succeed with no warning messages, or fail). Functions that delete information try to push through even if some errors (other than invalid parameters or domain not found in the configuration file or some other major problem in the very beginning) occur.
These operations can succeed and still give warnings. The operations that change information behave somewhat similarly to the ones that delete them.
To see the syntax for any command, type the following at the command line.
<script name> --help
This section explains the usage and syntax of scripts that you can use for:
The Ensim Pro file system maintains site information by assigning each domain a number and a corresponding top-level UNIX user through which it identifies the site’s following basic information.
Each site on your server is known to the file system as site<n> (called the site handle). The top-level UNIX user is known as admin<n>, where n is a number matching the site number.
The top-level UNIX user is the user handle to the site. Process lists will not show Site Administrator names, but instead show top-level UNIX user names.
Using the ps command will not show which process belongs to which domain. Use the sitelookup command after ps, to map a UNIX user to a site and view information about the sites on your server.
/usr/local/bin/sitelookup [-a] [-w <
wp_user>] [-s <
site_handle>] \
domain
[-d <>] [-u <
site_admin>] \
[domain, wp_user, site_handle, site_root, site_admin]
where:
-a
returns information for all domains.-w
returns site information for the site identified by the top level UNIX user
<
wp_user>
you specify.-s
returns site information for the site identified by the site handle
<
site_handle>
you specify.-d
returns site information for the site identified by the domain name
<
domain>
you specify.-u
returns site information for the site identified by the user name of the domain’s Site Administrator
<
site_admin>
you
specify.The command returns the following information, as instructed.
site_root
- the domain’s root directory.domain
- the name of the domain on which the site resides.wp user
- the top level UNIX user.site admin
- the user name of the Site Administrator.site handle
- the file system’s name for the site.The following section lists some examples of this syntax.
1
The command:
sitelookup -w admin1 domain,site_handle
returns the following information associated with the top level UNIX user admin1:
For example:
example.com,site1
2
The command:
sitelookup -s site25 site_root
returns the name of the root directory of the site with the site handle site25.
For example:
/home/virtual/example1.example.com
3
The command:
sitelookup -a
returns the following for all the sites you manage.
For example:
example1.example.com,admin1,site1,
/home/virtual/example1.example.com,Pawan
example2.example.com,admin2,site2,
/home/virtual/example2.example.com,Dave
To change the password of the Appliance Administrator (appliance owner), use the passwd_appl_admin script. The new password must be entered on standard input to complete the script. The change is effected immediately without the need to restart Ensim Pro.
/usr/sbin/passwd_appl_admin <
appl_admin_name>
where:
<appl_admin_name> is the login name of the Appliance Administrator.
To change the password of the Site Administrator (domain owner), use the ChangeDomainPasswd script. This script will not exit until you complete the operation by entering the new password for the domain on standard input.
/usr/local/bin/ChangeDomainPasswd <
domain name> <
domain password on stdin>
where:
<
domain name>
is the name of the domain for which you want to change the password.<
domain password on stdin>
is the new password for the Site Administrator that you must enter to complete the script.To change the Site Administrator‘s email address, use the ChangeEmail script.
/usr/local/bin/ChangeEmail <
domain name> <
email address>
where:
<
domain name>
is the name of the domain for which you want to change the password.<
email address>
is the Site Administrator’s new email address.To change the password of the User Administrator (domain user), use the ChangePasswdVirtUser script. This script will not exit until you complete the operation by entering the user’s new password on standard input.
/usr/local/bin/ChangePasswdVirtUser <
domain name> <
username>
<
user’s password on stdin>
where:
<
domain name>
is the name of the domain.<
username>
is the user’s login name.<
user’s password on stdin>
is the user password you must enter on the standard input to complete the script.
ChangePasswdVirtUser example.com myname newpass
In this example, the script changes a user’s password with the following specifications.
Ensim Pro is shipped with a single default Service Plan that contains all the services and options you need to create and make Ensim Pro domains usable by your customers. However, you can add any number of additional Service Plans to suit the needs of your customers and their businesses.
Many Internet service providers find it most efficient to use a template-type Service Plan that provides the basic services and options that all their customers will use; then create additional Service Plans that add other optional services to meet specific customer needs. This way, they do not have to specify all services and options whenever they create a new Service Plan. By using a template Service Plan, they can automatically assign most services and options; then add specific additional services and options for new Service Plans.
To add a new Service Plan, use the AddPlan script.
/usr/local/bin/AddPlan
[-p <
source plan> | -s <
source site> | -d <
source domain> |
source IP
-i <> | -t <
source path>]
service
[-c <>,<
option>=<
value>,[on|off],... ...]
target plan
[-f | --force] <>
where:
<
source plan>
is the name of an existing Service Plan you want to use as the foundation or template for the new Service Plan. This option can be omitted, in which case the default Service Plan is used.<
source site>
,
<
source domain>
, and
<
source IP>
are three ways to specify a site whose configuration you want to use as the foundation or template for the new Service Plan.
![]()
If the -t option is used, the path will be /home/virtual/<sourcepath>/info/current.
<
service>
is the name of the service for which you want to specify options in this Service Plan.<
option>
is optional features, if any, that you want to specify for the service.<
value>
is what the option specifies, such as a name, password, or measurement.
<
value>
may be a single string (for example,
1 or
My User) or a list (for example,<
target plan>
is the name of the new Service Plan.The following services, with a description of their options, if any, are available.
Table 2-1 lists the services you can specify when you create a new Service Plan, as well as the services’ options and their values.
The following section lists some examples of the service plan syntax.
1
This example adds a new Service Plan called Gold. Gold uses the default Service Plan as its template, but excludes the CGI service.
AddPlan -p default -c cgi,off Gold
2
This example adds a new Service Plan called Gold. Gold uses the default Service Plan as its template, but includes the aliases service.
AddPlan -p default -c aliases,on,aliases=\[.org,.net\] Gold
To modify a Service Plan, use the EditPlan script.
/usr/local/bin/EditPlan
[-p <
source plan> | -s <
source site> | -d <
source domain> |
source IP
-i <> | -t <
source path>]
service
[-c <>,<
option>=<
value>,[on|off],... ...]
target plan
[-f | --force] <>
where:
<
source plan>
is the name of an existing Service Plan you want to use as the foundation or template to edit when editing the Service Plan. This option can be omitted, in which case the target Service Plan is used as the basis of the edit operation.<
source site>
,
<
source domain>
, and
<
source IP>
are three ways to specify a site whose configuration you want to use as the foundation or template to edit when editing the Service Plan.
![]()
If the -t option is used, the path will be /home/virtual/<sourcepath>/info/current.
<
service>
is the name of the service for which you want to specify options in this Service Plan.<
option>
is optional features, if any, that you want to specify for the service.<
value>
is what the option specifies, such as a name, password, or measurement.
<
value>
may be a single string (for example,
1 or
My User) or a list (for example,
\[1, 2, 3\])<
target plan>
is the name of the Service Plan created as a result of the edit operation.See Table 2-1 for a list of the services you can change or add to a Service Plan, as well as the services’ options and their values.
To remove a Service Plan, use the DeletePlan script.
/usr/local/bin/DeletePlan <
plan name>
where <
plan name>
is the name of the Service Plan you want to remove.
To add a domain, use the AddVirtDomain script. This script adds a domain with the specified domain information and services. If you want to create a domain using pre-configured settings, specify the name of the corresponding Service Plan.
Disabling bandwidth while adding a domain using the AddVirtDomain script induces erratic mail behavior. Do not disable bandwidth when you add a domain using the AddVirtDomain script.
Power Tools, a powerful new feature of Ensim Pro, can be enabled for a site using the scriptsmgr option. Once you enable Power Tools, Site Administrators can install and manage these tools using the Site Administrator control panel. Each tool follows the naming convention <tool_name>-<tool_version>, where <tool_name> is the name of the tool and <tool_version> is the version number of the tool. Example. gallery-1.3.4. Refer to the tabulated section Power Tools for the list of tools that are provided by Ensim Pro.
To enable Power Tools for a domain, enable the scriptsmgr option and the individual tools you want to enable. Individual tools that are not explicitly enabled will not be available to the site even if you enable the scriptsmgr option. Please refer to the example for help on enabling Power Tools for a domain.
Beginning with Ensim Pro 3.7, you can offer the following email scanning services for a site.
Please refer to the example for help on enabling the email scanning services for a domain.
Ensim Pro 4.0.3 introduces a suite of Web services called Ignite that provide cutting-edge business solutions to help enhance your business. Services include email marketing solutions to help you market your product and services, search engine optimization services to help you promote your Web site, and payment systems and site authentication services for your ecommerce business. These services are also available to your resellers.
You can enable Ignite services when you create or update a Service Plan or a site.
Please refer to the example for help on enabling the Ignite services for a domain. The tabulated section Ignite services lists the various Ignite options you can use on the command line.
/usr/local/bin/AddVirtDomain
[-p <
source plan> | -s <
source site> | -d <
source domain> |
-i <
source IP> |-t <
source path>]
[-c <
service>,<
option>=<
value>,[on|off],... ...] [-f | --force]
where:
<
source plan>
is the name of an existing Service Plan you want to use as the foundation or template to edit when editing the Service Plan. This option can be omitted, in which case the target Service Plan is used as the basis of the edit operation.<
source site>
,
<
source domain>
, and
<
source IP>
are three ways to specify a site whose configuration you want to use as the foundation or template to edit when editing the Service Plan.
![]()
If the -t option is used, the path will be /home/virtual/<sourcepath>/info/current.
<
service>
is the name of the service for which you want to specify options in this Service Plan.<
option>
is optional features, if any, that you want to specify for the service.<
value>
is what the option specifies, such as a name, password, or measurement.
<
value>
may be a single string (for example,
1 or
My User) or a list (for example,
\[1, 2, 3\]).See Table 2-1 for a list of service options, and their respective values, that you can specify on the command line while adding a domain.
![]()
Options specified on the command line override the corresponding default values set in the Service Plan.
To add a domain
AddVirtDomain -p default \
-c siteinfo,domain=example.com,admin_user=myname,tpasswd=go12 \
-c ipinfo,namebased=0,ipaddrs=\[10.8.3.65\] \
-c telnet,off \
-c analog,on \
-c scriptsmgr,on,formmail-4.2b=1,gallery-1.3.4=1 \
-c users,maxusers=75 \
-c spam_filter,on \
-c mailscanner,on,scan_incoming=1,scan_outgoing=1 \
-c aspmgr,on,siteopti_add=1,siteopti_manage=1,emailmark_manage=1
In this example, the script adds a domain example.com with the following specifications.
To change the disk space allocated to a domain, use the ChangeQuota script.
/usr/local/bin/ChangeQuota <
domain name> <
quota>
where:
<
domain name>
is the name of the domain for which you want to change the disk quota.<
quota>
is the amount of disk space you want to allocate to the domain.To modify a domain’s information or Service Plan, use the EditVirtDomain script. The script allows you to update domain information and service settings, and enable or disable Power Tools and other services for a domain. Please refer to the examples for help on usage of the script.
/usr/local/bin/EditVirtDomain
[-p <
source plan> | -s <
source site> | -d <
source domain> |
-i <
source IP> |-t <
source path>]
[-c <
service>,<
option>=<
value>,[on|off],... ...]
[-f | --force]
[<
target site> | -I <
target IP> | -D <
target domain>]
where:
<
source plan>
is the name of an existing Service Plan you want to use as the foundation or template to edit when editing the site. This option can be omitted, in which case the target site’s current service options are used as the basis of the edit operation.<
source site>
,
<
source domain>
, and
<
source IP>
are three ways to specify a site whose configuration you want to use as the foundation or template to edit when editing the Service Plan.
![]()
If the -t option is used, the path will be /home/virtual/<sourcepath>/info/current.
<
service>
is the name of the service for which you want to specify options in this Service Plan.<
option>
is optional features, if any, that you want to specify for the service.<
value>
is what the option specifies, such as a name, password, or measurement.
<
value>
may be a single string (for example,
1 or
My User) or a list (for example,
\[1, 2, 3\]).<
target site>
,
<
target IP>
and
<
target domain>
are three ways in which to specify the site you want to edit.See Table 2-1 for a list of service options you can change or add to a domain, as well as the options’ values.
The following section lists some examples of this syntax.
1
In this example, the script changes the Service Plan of the domain example.com to Gold, disables the formmail-4.2b tool, and enables the phpnuke-6.9 tool and CGI service for the domain, not originally a part of the Gold Service Plan.
EditVirtDomain -p Gold -c cgi,on, -c scriptsmgr,on,formmail-4.2b=0,phpnuke-6.9=1 example.com
2
In this example, the script changes the Service Plan of the domain example.com to Basic, disables the Spam Filtering service, disables virus scanning for outgoing emails, and enables the aliases service for the domain.
EditVirtDomain -p Basic -c spam_filter,off \
-c mailscanner,on,scan_outgoing=0 \
-c aliases,on,aliases=\[domainname.org,domainname.net\] \
-c aspmgr,siteopti_add=1,siteopti_manage=1,emailmark_manage=0 \ example.com
Disabling a domain can be useful in managing customers whose accounts are overdue or in question. To disable a domain, use the DisableVirtDomain script.
/usr/local/bin/DisableVirtDomain <
domain name>
where <
domain name>
is the name of the domain you want to disable.
To enable a domain, use the EnableVirtDomain script.
/usr/local/bin/EnableVirtDomain <
domain name>
where <
domain name>
is the name of the domain you want to enable.
To view a list of all the domains on a specific Ensim Pro server, use the ListAllVirtDomains script.
This script returns the following:
/usr/local/bin/ListAllVirtDomains
To remove a domain from a server, use the DeleteVirtDomain script.
/usr/local/bin/DeleteVirtDomain <
domain name>
where <
domain name>
is the name of the domain you want to remove.
To disable a service on a specific domain, use the DisableVirtOption script. This script disables a specific service, but otherwise does not change the domain’s Service Plan.
/usr/local/bin/DisableVirtOption <
domain name> <
service>
where:
<
domain name>
is the name of the domain for which you want to disable the service<
service>
is the name of the service you want to disable as described in
Table 2-1.To enable a service on a specific domain, use the EnableVirtOption script.
/usr/local/bin/EnableVirtOption <
domain name> <
service>
where:
<
domain name>
is the name of the domain for which the service is enabled.<
service>
is the name of the service you want to enable as described in
Table 2-1.To hide a service, use the hide_service script. This script removes the service from the Ensim Pro control panel so that the Appliance Administrator cannot create domains with this service enabled.
The services that you can hide or reveal are:
* bind
* mivamerchant
* mysql
* telnet
* tomcat
/usr/local/bin/hide_service <
service>
where <
service>
is the name of the service you want to hide from the Ensim Pro control panel.
Example:
/usr/local/bin/hide_service bind
or
/usr/local/bin/hide_service telnet
To reveal a hidden service, use the unhide_service script. This script reinstates the service in the Ensim Pro control panel.
The services that you can hide or reveal are:
* bind
* mivamerchant
* mysql
* telnet
* tomcat
/usr/local/bin/unhide_service <
service>
where <
service>
is the name of the service you want to reinstate in the Ensim Pro control panel.
Example:
/usr/local/bin/unhide_service bind
or
/usr/local/bin/unhide_service telnet
To add a user to a domain, use the AddVirtUser script. This script adds a user to a domain, specifying the information Ensim Pro needs to establish the user, as well as the server applications to which the user should be granted access.
You can specify the user’s password in either of two ways.
/usr/local/bin/AddVirtUser [tpasswd=<
ctxtpwd> | cpasswd=<
crpwd> | passwd] \ <
domain name> <
username> <
user’s full name> <
user’s disk quota> \ <
service>=<
value>
where:
<
ctxtpwd>
is the user’s password in plain text. Use the
tpasswd
option to include the user’s password in the command in plain text.<
crpwd>
is the user’s password in encrypted text. Use the
cpasswd
option to include the user’s password in the command in encrypted text.
![]()
To use this option, you first need to employ encryption software to encrypt the password. Enter the encrypted text in this variable.
passwd
Use this option to enter the user’s password on the standard input. The command will not exit until you enter and confirm the password.
![]()
Use any one of the above three options to enter the user’s password depending on the security level desired while entering the password.
<
domain name>
is the name of the domain to which you are adding the user.<
username>
is the user’s login name.<
user’s full name>
is the user’s first and last name. To include spaces between the first and last name, enclose the full name in ““.<
user’s disk quota>
is the amount of disk space you are allocating to this user.<
service>
is the server application to which you are granting the user access.
![]()
The services currently available are Telnet, ProFTPd, and SSH.
<
value>
is a number, either 1 to enable or 0 to disable, the service.
AddVirtUser tpasswd=MTVrules example.com JoBoy “John Doe” 20 \
telnet=1 ssh=1 proftpd=1
In this example, the script adds a user with the following specifications.
To change the maximum number of users allowed on a domain, use the ChangeMaxUsers script.
/usr/local/bin/ChangeMaxUsers <
domain name> <
number of users>
where:
<
domain name>
is the name of the domain for which you want to change the number of users.<
number of users>
is the new maximum number of users you want to specify.To change a user’s full name, use the ChangeFullNameVirtUser script.
/usr/local/bin/ChangeFullNameVirtUser <
domain name> <
username> <
user’s full name>
where:
<
domain name>
is the name of the domain.<
username>
is the user’s login name.<
user’s full name>
is the user’s first and last name. To include spaces between the first and last name enclose the full name in ““.
ChangeFullNameVirtUser example.com Myname “Myname New”
Here, the script changes the user’s full name with the following specifications.
To change a user’s information, use the ChangeInfoVirtUser script. This script changes a user’s full name and the amount of disk space allocated to the user.
/usr/local/bin/ChangeInfoVirtUser <
domain name> <
username> <
user’s full name> <
quota>
where:
<
domain name>
is the name of the domain.<
username>
is the user’s login name.<
user’s full name>
is the user’s first and last name. To include spaces between the first and last name enclose the full name in ““.<
quota>
is the new amount of disk space you are allocating to this user.
ChangeInfoVirtUser example.com Myname “Myname New” 30
Here, the script changes the user’s information with the following specifications.
To remove a user from a domain, use the DeleteVirtUser script.
/usr/local/bin/DeleteVirtUser <
domain name> <
username>
where:
<
domain name> is the name of the domain from which you are deleting this user.<
username>
is the user’s login name.To configure logrotate settings, use the logrotate_be script
logrotate_be [options]
Options
Notes
You can use the quota_report script to obtain a statistical report on the storage limits and usage of disk space allocated to “users” or “groups”. When you run the script, it invokes a system call quotactl that returns the following quota storage and usage information, one line for each unit of information, for the specified user ID and group ID.
Each line in the output translates to the following information:
Output Line 1:
User quota enabled/disabled : Group quota enabled/disabled.
Uses “1” or “0” to indicate whether the user or group quotas are enabled or disabled respectively.
Output Line 2:
Current disk space occupied by quotas (in 1024-byte blocks)
Displays the current disk space occupied by quotas in blocks of 1024-bytes.
Output Line 3:
Preferred limit on disk space (in Kilobytes)
The preferred or “soft” limit indicates the maximum amount of disk space a user has on a partition. If you set the absolute limit and the time limit for excessive disk usage then the user can exceed the preferred limit and continue to use additional disk space until:
Once the absolute limit or the time limit expires, the user is prevented from using additional disk space until the user moderates disk space usage below the preferred limit. This resets the time limit assigned for excessive disk usage.
If the absolute limit or the time limit for excessive disk usage is not set the user cannot use disk space in excess of the preferred limit.
Output Line 4:
Absolute limit on disk space (in Kilobytes)
The absolute or “hard” limit indicates the maximum permissible limit for disk space usage within the set time limit. On exceeding the limit or the time period, the user is prevented from using additional disk space until disk space consumption is moderated below the preferred limit.
Output Line 5:
Time limit for excessive disk usage
The time, in number of minutes, available for using or allocating disk space in excess of the “preferred” limit. On expiry of the time limit you will be unable to allocate or use additional disk space. The default time limit is set to one week or seven days.
Output Line 6:
Number of inodes used currently
The number of inodes that are used currently.
Output Line 7:
Preferred limit for inodes
The preferred or “soft” limit indicates the maximum number of inodes that can be stored on a user’s allocated disk space. If you set the absolute limit and the time limit for additional inodes then the user can exceed the preferred limit for inodes until:
Once the absolute limit or the time limit expires, additional inodes cannot be created until the user reduces disk space usage below the preferred limit. This resets the time limit assigned for additional inodes.
If the absolute limit or the time limit for additional inodes is not set then inodes in excess of the preferred limit cannot be supported.
Output Line 8:
Absolute limit on inodes
The absolute or “hard” limit indicates the maximum permissible limit for the number of inodes that can be stored on the disk space within the set time limit. If the absolute limit or the time period is exceeded, no additional inodes can be created until disk space consumption is moderated below the preferred limit.
Output Line 9: Time limit for excessive inode usage
The time, in number of minutes, available for supporting additional inodes in excess of the “preferred” limit. On expiry of the time limit you will be unable to support additional inodes. The default time limit is set to one week or seven days.
Ensim Pro sets and manages quotas with the following default parameters.
* The “preferred” and “absolute” quota limits are equal.
* inode limits are not set.
/usr/bin/quota_report -d <directory> [-q|-u <uid>|-g <gid>]
Sample script and output
# quota_report -d / -g 504
1:1
36376
512000
512000
0
4445
0
0
0
To export appliance, reseller, site, or user’s data for backup, use the vhexport script.
/usr/local/bin/vhexport
-h|--help
-a|--appliance-info
-r|--reseller reseller1[,info][,site1,site2,...,site<n>]
-s|--sites site1,site2,...,site<n>
-u|--users site1,user1,user2,...,user<n> ...
-u|--users user1@domain.com,user2@domain.net,... ...
[-U|--URL <destination URL>] [-f|--url-info-file=<file>]
[-t|--split-threshold <size>]
[-z|--compressed]
[-c|--crypt] [-A|--algo=<algorithm>] [-k|--key-from-fd=<fd>]
Individual exports will be made for each reseller, site, and user specified. Note that site exports include the necessary information to recreate users when imported. When specifying a <destination URL>, the proper '.tar.gz' or '.tar' ending will automatically be added to the end of the URL, based on whether compression is set or not, respectively.
The <destination URL> may also contain format specifiers for the purpose of automatically generating URLs when one or more exports are being made with a single invocation.
The following time-related format specifiers are allowed (these are the format specifiers as understood by the server's C library strftime() function; please see the strftime() manual reference for more information):
In addition, the following format specifiers allow you to include information about the type of export being made:
For example, the command:
vhexport -u joe@mydomain.com,bob@yourdomain.net -U file:///tmp/%H_%t_%N_%Y_%B_%
on the server appliance.ensim.com will result in the following exports being created (assuming the date is December 23, 2002):
/tmp/appliance.ensim.com_user_joe@mydomain.com_2002_December_23.tar
/tmp/appliance.ensim.com_user_bob@yourdomain.net_2002_December_23.tar
If the -z option was specified, the resulting exports would have been:
/tmp/appliance.ensim.com_user_joe@mydomain.com_2002_December_23.tar.gz
/tmp/appliance.ensim.com_user_bob@yourdomain.net_2002_December_23.tar.gz
-f|--url-info-file specifies a file that contains additional information to be used with any URLs specified. It is generally not safe to include a password on the command line; you can use this option to point to a file that contains the password information. Note that if you choose to do this, you should make sure that the file is readable only by you. The file may contain two or three bits of information: host and user are mandatory; pass is optional.
An example file might contain:
-t|--split-threshold-size determines how large each output file is allowed to grow before another output file is started, and may only be specified if the -U|--URL argument is specified too. The argument must be a number optionally followed by a unit; the unit may be any one of b (1), kd (1000), k (1024), md (1,000,000), m (1,024,768), gd (1,000,000,000) or g (1,073,741,824), and defaults to “m”. This option is useful when exporting a large site or user, and the target server cannot handle files that are larger than a certain size.
For example, assume the site example.com would consume 3 GB of space, but the destination server cannot handle files larger than 1 GB. The command:
vhexport --sites example.com -U ftp://mybackupserver.com/%t_%N -t 1g
will result in the following files being created:
When importing, only the first URL in the above list should be specified. The import process will automatically attempt to retrieve the other files.
-c|--crypt specifies that the resulting export data should be encrypted before being written to the destination. A symmetric cipher is used. If the -k|--key-from-fd option is not specified, you will be prompted to enter a passphrase. -k|--key-from-fd may be used to specify a file descriptor from which the passphrase may be read. If set to 0, this will be equivalent to reading from standard in. -a|--algo allows you to change the cipher algorithm used (this option is not currently supported; that is, there is only a single type of cipher). Note that you must use the -U|--URL argument to specify the export destination if you don't use the -k|--key-from-fd option.
To import appliance, reseller, site, or user’s data from a backup, use the vhimport script.
/usr/local/bin/vhimport
-r|--role=appliance
reseller:<reseller name or id>
siteadmin:<domain name or site id>
siteuser:<user@domain or user@site id>
[-t|--target=<reseller name or id>]
[-t|--target=<domain name or site id>]
[-t|--target=<user@domain or user@site id>]
[--restore-user-configs] [--restore-site-configs]
[--restore-reseller-configs] [--overwrite-data]
[-U|--URL=<source URL>] [-R|--recurse]
[-f|--url-info-file=<file>]
[-S|--services service1,...]
[-d|--decrypt] [-A|--algo=<algorithm>] [-k|--key-from-
fd=<fd>]
If the role argument is not appliance, you must specify additional information to identify the reseller, site administrator, or site user on whose behalf the import is being performed.
If only importing a single file, you may specify the intended target of the import. For example, if the role was set to appliance or reseller, the user would be able to import a backup made from site A into an existing site B, by specifying site B as the target. Targets may only be specified for imports where the imported entity has fewer privileges than the importing role, and the importing role must control the intended target. That is, an appliance may specify any target for reseller, site, or user imports, whereas a reseller may only specify a target for site or user imports, and the target must be a site or user under his or her control.
If a target is not specified, the target will either be assumed from the role argument or from the import data. For example, if the role was set to reseller and the import file was a reseller backup, then the target would be the reseller given with the role identifier. If the import file had been a site backup, then the target would be the domain described by the import file, and will be allowed as long as the specified reseller owns that site, or the site does not exist.
The --overwrite-data option signifies that the import should overwrite existing data. If not specified, only data present in the import but not in the target will be restored. Note that this flag does not affect reseller, site, or user configurations.
The --restore-user-configs option signifies that if any user imports are encountered, and the user currently exists, then the user's configuration will be set to the configuration saved in the archive. Without this option, an existing user's configuration will not be changed.
The --restore-site-configs option signifies that if any site imports are encountered, and the site currently exists, then the site's configuration will be set to the configuration saved in the archive. Without this option, an existing site's configuration will not be changed.
The --restore-reseller-configs option signifies that if any reseller imports are encountered, and the reseller currently exists, then the reseller's configuration will be set to the configuration saved in the archive. Without this option, an existing reseller's configuration will not be changed.
The --restore-all-configs option is equivalent to specifying --restore-user-configs --restore-site-configs --restore-reseller-configs together.
The --recurse option will cause any imports made at the same time as one of the imports specified on the command line to be imported as well. For example, if a user exported everything on the server (appliance, resellers, sites) in a single invocation of vhexport, then all the user would have to do to completely recover the system is import the appliance backup by specifying the --recurse option.
-f|--url-info-file specifies a file that contains additional information to be used with any URLs specified. It is generally not safe to include a password on the command line; you can use this option to point to a file that contains the password information. Note that if you choose to do this, you should make sure that the file is readable only by you. The file may contain two or three bits of information; host and user are mandatory, and pass is optional. An example file might contain:
-c|--crypt specifies that the import data is encrypted and must be decrypted before being restored. If the -k|--key-from-fd option is not specified, you will be prompted to enter a passphrase. -k|--key-from-fd may be used to specify a file descriptor from which the passphrase may be read. If set to 0, this will be equivalent to reading from standard in. -a|--algo allows you to change the cipher algorithm used (this option is not currently supported; that is, there is only a single type of cipher). Note that you must use the -U|--URL argument to specify the import source if you don't use the -k|--key-from-fd option, or if you set the -k|--key-from-fd option to 0.
This section explains the usage and syntax of scripts you can use to manage reseller accounts.
You can use command line scripts for:
Refer to Table 2-2 for the complete list of services, options, and values that you can specify for a reseller account.
You must specify values for services or options that you want to enable; no default values are set other than those explicitly specified in the table. Further, you cannot leave an option blank.
Table 2-2 lists the services, options, and values that you can specify for a reseller account.
To view the list of reseller accounts, use the ListResellers script. The script returns the list of resellers, one line of text for each reseller, with the specified account information, services, enabled options, and the corresponding values. In addition to the services and options enabled for the reseller, the list will also display the following information for the specified service.
*The password of a reseller will not be listed in the script output. Some values may have backslash-quoted characters (for example, spaces in the reseller full name).
*Bandwidth and quota values are returned in bytes.
/usr/local/bin/ListResellers
A sample output produced by the ListResellers script
The sample output used in the example has been word-wrapped for readability. The actual output is displayed in a single line, with the various services separated by a single space.
In this example, the script lists a reseller with the following account information:
To create a reseller account, use the AddReseller script. If you want to create reseller accounts that have a common set of services, you can use an existing reseller account as a template for the new reseller.
See Table 2-2 for the list of services, with corresponding options and values, that you can enable for the reseller account. On successful creation of the account, the message, Reseller <reseller name> successfully created, is displayed.
/usr/local/bin/AddReseller [ -r <source reseller> ] [ -c <service>,<option>=<value>,... ...]
where:
<
service>
is the name of the service for which you want to specify options for the reseller.<
option>
is the arguments or parameters that you want to specify for the reseller.<
value>
is what the option specifies, such as a name, password, or measurement.
Creating a reseller account without using a template
In this example, the script adds a reseller account with the following account information:
Creating a reseller account using a template
In this example, the script creates a new reseller account, with the user name reseller2, using another reseller account, reseller1, as the template on which to base the account information.
To modify a reseller account, use the EditReseller script. See Table 2-2 for the list of services, with corresponding options and values, that you can specify for the reseller account. On successful modification, the message, Reseller, <reseller_name> successfully updated, is displayed.
/usr/local/bin/EditReseller [ -r <source reseller> ] [ -c <service>,<option>=<value>,... ...] <reseller username>...
where:
EditReseller -c reseller,enabled=1,username=new_reseller, -c ipinfo,ipbased=15,namebased=15 old_reseller
In this example, the script modifies the user name and site information for an existing reseller account.
To remove a reseller account, use the DeleteReseller script.
/usr/local/bin/DeleteReseller <reseller username>
where
<reseller username> is the user name of the reseller you want to remove
/usr/local/bin/DeleteReseller reseller1
In this example, the script removes the reseller account with the user name, reseller1.
Ensim
Corporation www.ensim.com Contact Ensim www.ensim.com/about/contact.html |
![]() ![]() ![]() ![]() |