Restoring sub server only

8 posts / 0 new
Last post
#1 Wed, 02/11/2009 - 05:18
jflesher

Restoring sub server only

Is it possible to Restore sub server only? If so how do you do it? I've tried everything; it seems it will restore the primary domain first (which would be a disaster) then it restores the sub servers.

I'm trying to create a demo site, it would have to be restored every hour or so on a schedule.

Thanks

Wed, 02/11/2009 - 09:07
andreychek

What backup format are you using?

If you choose the "One file per server" option, there should only be enough data in there to restore the Sub-Server, it shouldn't be able to do anything to any other Virtual Servers.
-Eric

Wed, 02/11/2009 - 09:55
jflesher

I'm using "one file per server".

I did notice that originally it didn't backup the sub server; I assumed it was in the same file as the parent; I did check "Include sub-servers of those selected"; maybe I needed to re-save my scheduled backups; since it did back them up after I did this.

How can I schedule a restore?
I did read about command line restore-domain.pl and see that I can schedule CRON jobs; can I use it to schedule a restore every hour or is there a better way to do this.

Thanks

Jeffrey Scott Flesher
Medically Retired Gulf War Vet

Thu, 02/12/2009 - 11:07
jflesher

Can someone give me an example of using the command line to automate a restore?

Jeffrey Scott Flesher
Medically Retired Gulf War Vet

Thu, 02/12/2009 - 13:05 (Reply to #4)
andreychek

You would just use the restore-domain.pl script:

http://www.virtualmin.com/documentation/id,virtualmin_api_restore_domain/

You can setup a cron job to have it run once a day or whatever, and just have it do something like:

restore-domain.pl --source /path/to/backup_file.tar.gz

The URL above has some options for restoring over a network too if you prefer.
-Eric

Thu, 02/12/2009 - 13:25
jflesher

Just to document what I did.
I created a CRON Job

Execute cron job as <b>root</b>
Active? <b>Yes</b>
Command <b>/usr/libexec/webmin/virtual-server/restore-domain.pl --source /path/to/mydomain.tar.gz --domain mydomain --all-features</b>
Simple schedule <b>Hourly</b>

Jeffrey Scott Flesher
Medically Retired Gulf War Vet

Thu, 02/12/2009 - 13:35
jflesher

One thing I didn't understand was the &quot;Input to command&quot; box; this is where I was trying to put the command line arguments; but it didn't work.

In fact that was my whole problem; once I looked at other CRON jobs I notice it wasn't being used and then I added them to the command and it worked fine.

Jeffrey Scott Flesher
Medically Retired Gulf War Vet

Thu, 02/12/2009 - 14:07 (Reply to #7)
andreychek

Yeah, that is a little confusing.

Some scripts require input after starting -- for example, the &quot;passwd&quot; command prompts for a password.

The &quot;input to command&quot; option allows you to send input to a program that prompts for it.
-Eric

Topic locked