diff --git a/web/keys.sample.php b/web/keys.sample.php index 63509ca..cd9b7ca 100644 --- a/web/keys.sample.php +++ b/web/keys.sample.php @@ -3,6 +3,7 @@ define('YIIMP_MYSQLDUMP_USER', 'root'); define('YIIMP_MYSQLDUMP_PASS', ''); +define('YIIMP_MYSQLDUMP_PATH', '/root/backup'); /* Keys required to create/cancel orders and access your balances/deposit addresses */ define('EXCH_BITTREX_SECRET', ''); diff --git a/web/yaamp/core/backend/system.php b/web/yaamp/core/backend/system.php index b70da2c..7b2e169 100644 --- a/web/yaamp/core/backend/system.php +++ b/web/yaamp/core/backend/system.php @@ -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"); diff --git a/web/yaamp/defaultconfig.php b/web/yaamp/defaultconfig.php index 0674be9..5a41749 100644 --- a/web/yaamp/defaultconfig.php +++ b/web/yaamp/defaultconfig.php @@ -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');