Backup one or more virtual servers
This program is analogous to the Backup Virtual Servers page in the Virtualmin web interface.
It will create either a single backup file or multiple separate files containing the domains specified on the command line,
either locally or on a remote SCP or FTP server.
--dest option sets the backup destination,
and can be a simple path like
an FTP URL like
or an SCP URL like
When backing up to a single file,
the path specifies a file that will be created.
When creating one backup per domain,
it specifies a directory instead.
--all-domains options can be used to control which virtual servers are included in the backup.
--domain parameter followed by a domain name can be given multiple times,
to select more than one server.
virtual servers can be selected with the
--user flag followed by an administrator's username,
--plan followed by a plan name.
In both cases,
all sub-servers will be included too.
--all-features option will be used to include all virtual server features in the backup,
but you can instead use the
--feature option one or more times to control exactly what gets included.
In this case,
it is wise to use at least
--feature dir to include each server's home directory.
--separate option tells the backup program to create a separate file for each virtual server.
--newformat also causes multiple files to be created,
but using the format supported by Virtualmin versions 2.86 and above which puts all information into each domain's home directory,
and thus avoids the need to create a large file in
/tmp during the backup process.
--ignore-errors option means than any errors encountered backing up one feature or server will be reported and ignored,
rather than terminating the whole backup as happens by default.
To include core Virtualmin settings in the backup,
--all-virtualmin option can be specified as well.
you can select exactly which settings to include with the
--virtualmin config would only backup the module configuration.
backups include all files in each domain's home directory.
if you use the
only those changed since the last non-incremental backup will be included.
This allows you to reduce the size of backups for large websites that rarely change,
but means that when restoring both the full and incremental backups are needed.
To exclude some files from each virtual server's home directory from the backup,
--exclude flag followed by a relative filename,
like public_html/stats or .bashrc.
To have Virtualmin automatically replace strftime-style date formatting characters in the backup destination,
you can use the
When this is enabled,
--purge flag can also be given,
followed by a number of days.
The command will then delete backups in the same desination directory older than the specified number of days.
Command Line Help
Creates a Virtualmin backup, for the domains and features specified on the command line. virtualmin backup-domain [--dest file]+ [--test] [--domain name] | [--all-domains] [--user name] [--plan name] [--feature name] | [--all-features] [--except-feature name] [--ignore-errors] [--separate] | [--newformat] [--onebyone] [--strftime] [--purge days] [--incremental] [--all-virtualmin] | [--virtualmin config] [--option "feature name value"] [--as-owner] [--exclude file]* Multiple domains may be specified with multiple --domain parameters. Features must be specified using their short names, like web and dns. The destination can be one of : - A local file, like /backup/yourdomain.com.tgz - An FTP destination, like ftp://login:pass@server/backup/yourdomain.com.tgz - An SSH destination, like ssh://login:pass@server/backup/yourdomain.com.tgz - An S3 bucket, like s3://accesskey:secretkey@bucket Multiple destinations can be given, if they are all remote.