Add virtual server vars to backup names

Just a quick idea. How about adding a few virtual server variables for specifying backup file/directory names? For example, __DOMAIN__ could substitute the domain name. You could have __ADMIN_USER__, __ADMIN_GROUP__ and I think __HOME_DIR__ would also be useful.

Here's what local file "backup destination" could look like:
__HOME_DIR__/backups/%a_%e-%b-%y_%I-%M-%p to produce "/home/username/Sun_28-Sep-08_10-07-AM"

Note that I'm assuming the backup doesn't backup the entire contents of the home dir, or this example would cause a problem where the file being written was trying to include itself...

I'm more likely to use it like this though:
/back/__ADMIN_USER___%a_%e-%b-%y_%I-%M-%p to give "/back/username_Sun_28-Sep-08_10-07-AM"

With this example, I only have to create 1 scheduled backup which would backup all my virtual hosts. Right now, I have to create an individual backup for each virtual host if I want the admin username hardcoded in the filenames.

Status: 
Active

Comments

I suppose this could be done, but I'm not sure if I would recommend using it .. the reason is that if you spread out backups like this, restoring multiple domains is hard because Virtualmin expects all their files to be in a single directory.

Oh, I see. I guess I was planning that if I ever had to restore from backup, I would just do it one host at time.

Also, in your examples, would /home/username/Sun_28-Sep-08_10-07-AM be a directory name or a filename?

In my example the date_time format portion at the end is the filename. Without the suggested __FOO__ vars, how would this currently be interpreted? "/existing_dir/existing_subdir/hardcoded_filename_%a_%e-%b-%y_%I-%M-%p" Having never run a backup, I was guessing something like .tgz or .tar.gz would be appended to whatever your backup script turned the vars into.

Jamie: "Virtualmin expects all their files to be in a single directory." Are you saying that you cannot restore virtual servers one server at a time? I was also actually going to use this to move a virtual server from one host to another.

At this point, I'm thinking I should move this discussion to the forums, where in hindsight I'm thinking it might be better to have people review a feature request before taking your time by making it an "official" request...

Are you saying that you cannot restore virtual servers one server at a time? I was also actually going to use this to move a virtual server from one host to another.

You can restore multiple virtual servers at once, but if they have all been backed up to separate files (one per domain), they all need to be in the same directory.

I am thinking that for a complex backup strategy like this, you might want to look into scripting it using the Virtualmin command-line API. If you know some shell scripting, it isn't too hard .. see :

http://www.virtualmin.com/documentation/developer/cli and http://www.virtualmin.com/documentation/developer/cli/backup_domain