def backup_yestoday_job(): pre = datetime.now() - timedelta(1) d = pre.strftime("%Y-%m-%d") logging.info('backup data of %s' % d) update_today_db(update=True, date=d) data_dir = os.path.join(DATA_DEST_ROOT, d) if os.path.exists(data_dir): rmtree(data_dir) logging.info('Remove dir: %s' % data_dir) logging.info('backup data end')
def update_interval_job(): logging.info("begin update data") update_today_db(True) logging.info('end update data')