{{deploy_path}}/database/rotatemap.conf'); } if (!test("[ -d {{deploy_path}}/database/backup ]")) { run("mkdir -p {{deploy_path}}/database/backup"); } $source_name = parse_ini_file(get('db_conf_path'))['database']; if (test("[ -f {{deploy_path}}/database/backup/backup.sql ]")) { run("logrotate -f -s {{deploy_path}}/database/rotatemap.state {{deploy_path}}/database/rotatemap.conf"); } run("{{bin/mysqldump}} --defaults-extra-file={{db_conf_path}} --opt --no-create-db -f ".$source_name." $({{bin/mysql}} --defaults-extra-file={{db_conf_path}} -ANe\"SET group_concat_max_len = 10485760; SELECT GROUP_CONCAT(table_name SEPARATOR ' ') FROM information_schema.tables WHERE table_schema='".$source_name."' AND engine IS NOT NULL;\") > {{deploy_path}}/database/backup/backup.sql"); info('successfully dumped to {{deploy_path}}/database/backup/backup.sql'); } else { warning('missing config, task skipped'); } });