Les fichiers pour installer le serveur NALC.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.1 KiB

#!/bin/bash
# Variables à modifier
bdd=nalc-0.4.17
worldname=nalc
servername=nalc-server-0.4.17-r1
serverpath=/home/minetest/$servername
bak=$serverpath/backup
world=$serverpath/minetest/worlds/$worldname
if [[ ! -d $bak ]]; then
mkdir -p $bak
fi
bak_tmp=/var/tmp/$servername
if [[ ! -d $bak_tmp ]]; then
mkdir $bak_tmp
fi
cp $serverpath/minetest/minetest.conf $bak/
cp $serverpath/start.sh $bak/
cp $serverpath/backup.sh $bak/
cp $serverpath/shutdown.sh $bak/
pushd $world
rm -r rollback.sqlite
tar -I pbzip2 -cf $bak/world.tar.bz2 . # <-- requiert pbzip2, à installer avant !
popd
pg_dump -F c -f $bak_tmp/$bdd.dump $bdd
pg_dump -F c -f $bak_tmp/players-$bdd.dump players-$bdd
pushd $bak_tmp
tar --label=SQL_DUMP-$servername -cf $bak/dump_sql.tar --remove-files *.dump
popd
log_dir=$serverpath/logs
[[ ! -d $log_dir ]] && mkdir $log_dir
pushd $log_dir
if [[ -f moredebug.log ]]; then
d=$(date +%Y-%m-%d.%H.%M.%S)
mv moredebug.log moredebug_$d.log
bzip2 moredebug_$d.log
tar --label=LOGS-$servername -rf moredebug-logs.tar --remove-files moredebug*.log.bz2
fi
popd