backup-domain.pl
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.
The --dest option sets the backup destination, and can be a simple path like /backup/virtualmin.tgz , an FTP URL like ftp://user:pass@server:/backup/virtualmin.tgz , or an SCP URL like ssh://user:pass@server:/backup/virtualmin.tgz . 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.
The --domain and --all-domains options can be used to control which virtual servers are included in the backup. The --domain parameter followed by a domain name can be given multiple times, to select more than one server.
Typically the --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.
The --separate option tells the backup program to create a separate file for each virtual server. The --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.
Using the --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, the --all-virtualmin option can be specified as well. Alternately, you can select exactly which settings to include with the --virtualmin parameter. For example, --virtualmin config would only backup the module configuration.
By default, backups include all files in each domain's home directory. However, if you use the --incremental parameter, 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.
Command Line Help
Creates a Virtualmin backup, for the domains and features specified
on the command line.
usage: backup-domain.pl --dest file
[--test]
[--domain name] | [--all-domains]
[--user name]
[--feature name] | [--all-features]
[--except-feature name]
[--ignore-errors]
[--separate] | [--newformat]
[--onebyone]
[--incremental]
[--all-virtualmin] | [--virtualmin config]
[--option feature name value]
[--mailfiles]
[--as-owner]
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