On Tue December 20 2005 03:30, Gerhard Hofmann wrote: > Hi list, > > I'm a newbie to vserver and I wonder how to backup my vserver guests > with a cron job run by the vserver host. > > I think it should be something like that: > vserver myvserver stop > ...compress /etc/vserver to a tgz file and save on external storage... > vserver myvserver start > > Have I forgotten something important here? > > Myvserver will run mysql and apache (TYPO3 content management system), > so I think it won't hurt to run a mysqldump before shutting down and > backing up myvserver. > That would give you the most consistent backup of the content management system. Of course it means there is a time-of-day when you can have the vserver out of service.
One of the reasons for running mysqldump is so a consistent version of the database files is dumped. An external-to-mysql backup program could catch the database files in an inconsistent state. But... If you have shut down the vserver, you have also shut down mysql, the file content is now static - if you don't need the mysqldump output for another reason - then you could skip that step. The same reasoning (system operation spans changes in multiple files) applies to apache, the content management system as a whole and the operation of the vserver. So shutting it (the entire vserver) down gives you the most consistent version of everything. If the system is used 24/7 and you can't shut it down for backups, then you could back it up with a host script that runs commands in the vserver context. (See Christian Heim's reply to this thread.) If the system is used 24/7 and is heavily loaded at all times, then things get tricky if you want a consistent set of files for the content management system (and the vserver and apache). Mike > What is the best way to invoke the mysqldump command within myvserver? A > separate cron job within the guest? > > TIA > Gerhard > > _______________________________________________ > Vserver mailing list > [email protected] > http://list.linux-vserver.org/mailman/listinfo/vserver > > _______________________________________________ Vserver mailing list [email protected] http://list.linux-vserver.org/mailman/listinfo/vserver
