nalc-server/doc/planSauvegarde.org

33 lines
1.9 KiB
Org Mode
Raw Normal View History

* Plan de sauvegarde et restauration du serveur NALC
** Quelques variables
NALC-SERVER=/home/minetest/nalc-server-0.4.17-r1
bak=$NALC-SERVER/backup
bak_tmp=/var/tmp/nalc-0.4_dump
log_dir=$NALC-SERVER/logs
** Tableau des sauvegardes
| Quoi | Comment | Depuis | Vers | Quand |
|-------------------------------------+---------------+--------------------------+-----------------------------------+-------|
| $NALC-SERVER/minetest/minetest.conf | cp | $NALC-SERVER/shutdown.sh | $bak/data/ | 5h00 |
| $NALC-SERVER/start.sh | cp | $NALC-SERVER/shutdown.sh | $bak/data/ | 5h00 |
| $NALC-SERVER/backup.sh | cp | $NALC-SERVER/shutdown.sh | $bak/data/ | 5h00 |
| $NALC-SERVER/minetest/worlds/nalc | tar -I pbzip2 | $NALC-SERVER/shutdown.sh | $bak/data/world.tar.bz2 | 5h00 |
| BDD nalc-0.4.17 | pg_dump -Fc | $NALC-SERVER/shutdown.sh | $bak_tmp/nalc-0.4.17.dump | 5h00 |
| BDD players-nalc-0.4.17 | pg_dump -Fc | $NALC-SERVER/shutdown.sh | $bak_tmp/players-nalc-0.4.17.dump | 5h00 |
| $bak_tmp/*.dump | tar | $NALC-SERVER/shutdown.sh | $bak/data/dump_sql.tar | 5h00 |
| $log_dir/moredebug.log | bzip2 && tar | $NALC-SERVER/shutdown.sh | $log_dir/moredebug-logs.tar | 5h00 |
** Étapes de restauration des BDD
#+BEGIN_EXAMPLE
$ cd $NALC-SERVER
$ mkdir dumps
$ cd dumps
$ tar -xvf $bak/data/dump_sql.tar
$ dropdb nalc-0.4.17
$ dropdb players-nalc-0.4.17
$ (login as postgresql user)
$ pg_restore -d nalc-0.4.17 $NALC-SERVER/dumps/nalc-0.4.17.dump
$ pg_restore -d players-nalc-0.4.17 $NALC-SERVER/dumps/players-nalc-0.4.17.dump
$ (logout)
$ rm -rf $NALC-SERVER/dumps
#+END_EXAMPLE