backend: add db backup folder to config #344

This commit is contained in:
Tanguy Pruvot 2019-03-28 18:56:39 +01:00
parent 4eb569c9ec
commit 826fbfb43d
3 changed files with 6 additions and 3 deletions

View file

@ -3,6 +3,7 @@
define('YIIMP_MYSQLDUMP_USER', 'root');
define('YIIMP_MYSQLDUMP_PASS', '<my_mysql_password>');
define('YIIMP_MYSQLDUMP_PATH', '/root/backup');
/* Keys required to create/cancel orders and access your balances/deposit addresses */
define('EXCH_BITTREX_SECRET', '<my_bittrex_api_secret_key>');

View file

@ -2,9 +2,6 @@
function BackendDoBackup()
{
$d = date('Y-m-d-H', time());
$filename = "/root/backup/yaamp-$d.sql";
if (is_readable("/usr/bin/xz")) {
$ziptool = "xz --threads=4"; $ext = ".xz";
} else {
@ -19,6 +16,9 @@ function BackendDoBackup()
$user = YIIMP_MYSQLDUMP_USER;
$pass = YIIMP_MYSQLDUMP_PASS;
$d = date('Y-m-d-H', time());
$filename = YIIMP_MYSQLDUMP_PATH.DIRECTORY_SEPARATOR."$db-$d.sql";
if (1) {
// faster on huge databases if the disk is fast (nvme), reduce the db lock time
system("mysqldump -h $host -u$user -p$pass --skip-extended-insert $db > $filename");

View file

@ -11,6 +11,8 @@ if (!defined('YAAMP_DBNAME')) define('YAAMP_DBNAME', 'yaamp');
if (!defined('YAAMP_DBUSER')) define('YAAMP_DBUSER', 'root');
if (!defined('YAAMP_DBPASSWORD')) define('YAAMP_DBPASSWORD', '');
if (!defined('YIIMP_MYSQLDUMP_PATH')) define('YIIMP_MYSQLDUMP_PATH', '/root/backup');
if (!defined('YIIMP_PUBLIC_EXPLORER')) define('YIIMP_PUBLIC_EXPLORER', true);
if (!defined('YIIMP_PUBLIC_BENCHMARK')) define('YIIMP_PUBLIC_BENCHMARK', false);
if (!defined('YIIMP_FIAT_ALTERNATIVE')) define('YIIMP_FIAT_ALTERNATIVE', 'EUR');