From 009a7393b815283b1836aff5430715ad69e9663f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Mon, 29 Apr 2019 11:40:34 +0900 Subject: [PATCH] Fix: batch files to root directory --- .../chocomae/backup_unregister_maestro.py | 5 +- .../batch/backup_unregister_maestro.py | 54 ------------------- .../chocomae/{helloworld.py => show_path.py} | 6 +-- .../chocomae/{test.py => test_submodule.py} | 0 4 files changed, 3 insertions(+), 62 deletions(-) delete mode 100644 src/web/python/chocomae/batch/backup_unregister_maestro.py rename src/web/python/chocomae/{helloworld.py => show_path.py} (61%) rename src/web/python/chocomae/{test.py => test_submodule.py} (100%) diff --git a/src/web/python/chocomae/backup_unregister_maestro.py b/src/web/python/chocomae/backup_unregister_maestro.py index 423a061..e3cba17 100644 --- a/src/web/python/chocomae/backup_unregister_maestro.py +++ b/src/web/python/chocomae/backup_unregister_maestro.py @@ -30,10 +30,9 @@ def backup_unregister_maestro_table_file(): if mode == 'mac': output_directory = '' today = datetime.today().strftime('%Y%m%d-%H%M%S') - output_filename = '> ' + today + '.sql' + output_filename = '> ' + output_directory + today + '.sql' - command_db_backup = command + user + password + transaction + db + table + where_clause \ - + output_directory + output_filename + command_db_backup = command + user + password + transaction + db + table + where_clause + output_filename # 'mysqldump -u "${DBUSER}" -p"${DBPASS}" --single-transaction "${DBNAME}" "${filename}" --where="DATE(${record_date})=CURDATE()" > "${filename}.dump.bydate.sql"' print(command_db_backup) # subprocess.call(command_db_backup) diff --git a/src/web/python/chocomae/batch/backup_unregister_maestro.py b/src/web/python/chocomae/batch/backup_unregister_maestro.py deleted file mode 100644 index ccb4fb8..0000000 --- a/src/web/python/chocomae/batch/backup_unregister_maestro.py +++ /dev/null @@ -1,54 +0,0 @@ -import sys -from datetime import datetime -import subprocess -from batch.unpaid_maestro_manager import UnpaidMaestroManager - - -print('# args : {}'.format(len(sys.argv))) -print('args : {}'.format(str(sys.argv))) -mode = 'mac' -arg_count = len(sys.argv) -if arg_count > 1: - mode = str(sys.argv[1]).lower(); - - -def print_items(list): - for item in list: - print(item) - - -def backup_unregister_maestro_table_file(): - space = ' ' - command = 'mysqldump' + space - user = '-u root' + space - password = '-p52napark!' + space - transaction = '--single-transaction' + space - db = 'chocomae' + space - table = 'maestro' + space - where_clause = '--where="DATE(NOW()) - INTERVAL 7 DAY > AcceptClausesDateTime AND ActivateStatus = 0"' + space - output_directory = '/home/chocomae/unregister-user-backup/' - if mode == 'mac': - output_directory = '' - today = datetime.today().strftime('%Y%m%d-%H%M%S') - output_filename = '> ' + today + '.sql' - - command_db_backup = command + user + password + transaction + db + table + where_clause \ - + output_directory + output_filename - # 'mysqldump -u "${DBUSER}" -p"${DBPASS}" --single-transaction "${DBNAME}" "${filename}" --where="DATE(${record_date})=CURDATE()" > "${filename}.dump.bydate.sql"' - print(command_db_backup) - subprocess.call(command_db_backup) - - -unpaidMaestroMan = UnpaidMaestroManager(mode) -maestro_list = unpaidMaestroMan.get_unpaid_7days_maestro_list() -print_items(maestro_list) - -backup_unregister_maestro_table_file() - -# print(mode) -''' -for maestro in maestro_list: - remark = maestro['Name'] + ' / unpaid 7 days' - unpaidMaestroMan.insert_maestro_log(maestro['MaestroID'], remark) - unpaidMaestroMan.delete_maestro_list(maestro['MaestroID']) -''' \ No newline at end of file diff --git a/src/web/python/chocomae/helloworld.py b/src/web/python/chocomae/show_path.py similarity index 61% rename from src/web/python/chocomae/helloworld.py rename to src/web/python/chocomae/show_path.py index 2185ce5..56b234d 100644 --- a/src/web/python/chocomae/helloworld.py +++ b/src/web/python/chocomae/show_path.py @@ -1,12 +1,8 @@ import sys import os -from lib.mail.module_b import ModuleB print('path :') path_list = sys.path print('path count : {}'.format(len(path_list))) for item in path_list: - print(item) - -mb = ModuleB() -mb.print() \ No newline at end of file + print(item) \ No newline at end of file diff --git a/src/web/python/chocomae/test.py b/src/web/python/chocomae/test_submodule.py similarity index 100% rename from src/web/python/chocomae/test.py rename to src/web/python/chocomae/test_submodule.py