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.

48 lines
1.1KB

  1. #!/bin/bash
  2. # Variables à modifier
  3. bdd=nalc-0.4.17
  4. worldname=nalc
  5. servername=nalc-server-0.4.17-r1
  6. serverpath=/home/minetest/$servername
  7. bak=$serverpath/backup
  8. world=$serverpath/minetest/worlds/$worldname
  9. if [[ ! -d $bak ]]; then
  10. mkdir -p $bak
  11. fi
  12. bak_tmp=/var/tmp/$servername
  13. if [[ ! -d $bak_tmp ]]; then
  14. mkdir $bak_tmp
  15. fi
  16. cp $serverpath/minetest/minetest.conf $bak/
  17. cp $serverpath/start.sh $bak/
  18. cp $serverpath/backup.sh $bak/
  19. cp $serverpath/shutdown.sh $bak/
  20. pushd $world
  21. rm -r rollback.sqlite
  22. tar -I pbzip2 -cf $bak/world.tar.bz2 . # <-- requiert pbzip2, à installer avant !
  23. popd
  24. pg_dump -F c -f $bak_tmp/$bdd.dump $bdd
  25. pg_dump -F c -f $bak_tmp/players-$bdd.dump players-$bdd
  26. pushd $bak_tmp
  27. tar --label=SQL_DUMP-$servername -cf $bak/dump_sql.tar --remove-files *.dump
  28. popd
  29. log_dir=$serverpath/logs
  30. [[ ! -d $log_dir ]] && mkdir $log_dir
  31. pushd $log_dir
  32. if [[ -f moredebug.log ]]; then
  33. d=$(date +%Y-%m-%d.%H.%M.%S)
  34. mv moredebug.log moredebug_$d.log
  35. bzip2 moredebug_$d.log
  36. tar --label=LOGS-$servername -rf moredebug-logs.tar --remove-files moredebug*.log.bz2
  37. fi
  38. popd