Commit 57834f7e authored by Rudel Fankep's avatar Rudel Fankep
Browse files

upload without tar

parent da57157a
#!/bin/bash
REMOTE_FILE=$1
LOCAL_DATABASE_DIRECTORY=$2
cd $LOCAL_DATABASE_DIRECTORY
s3cmd get $REMOTE_FILE
cd -
\ No newline at end of file
[]
\ No newline at end of file
[{"name": "swissprot", "tool": "blast", "version": "2019_06", "created": "2019-07-29"}]
\ No newline at end of file
......@@ -12,7 +12,7 @@ import json
def myparser():
parser = argparse.ArgumentParser(description='Download, convert and share the data to working computer', prog='PSOT_database_maker')
parser = argparse.ArgumentParser(description='Download, convert and share databases to working computer', prog='Database Manager')
subparsers = parser.add_subparsers(title='Subcommands', description='Authorized Subcommands', help='Additional help')
......@@ -196,7 +196,7 @@ def get_path_local_json(args):
def get_path_remote_json(args):
return path_maker(get_remote_databases_directory(args), 'dbman_remote_metadata.json.tar.gz')
return path_maker(get_remote_databases_directory(args), 'dbman_remote_metadata.json')
def get_local_metadata(args):
......@@ -217,7 +217,7 @@ def save_local_metadata(args, metaliste):
def get_remote_metadata(args):
if get_path_remote_json(args) in get_remote_files():
subprocess.run(['./download_db.sh', get_path_remote_json(args), get_local_databases_directory(args), 'dbman_remote_metadata.json.tar.gz'])
subprocess.run(['./download_json.sh', get_path_remote_json(args), get_local_databases_directory(args)])
with open(path_maker(get_local_databases_directory(args), 'dbman_remote_metadata.json')) as f:
metadata = json.load(f)
os.remove(path_maker(get_local_databases_directory(args), 'dbman_remote_metadata.json'))
......@@ -227,10 +227,10 @@ def get_remote_metadata(args):
def save_remote_metadata(args, metaliste):
with open('dbman_remote_metadata.json', 'w') as f:
with open(path_maker(get_local_databases_directory(args),'dbman_remote_metadata.json'), 'w') as f:
json.dump(metaliste, f)
subprocess.run(['./upload_db.sh', './', 'dbman_remote_metadata.json.tar.gz', 'dbman_remote_metadata.json', get_remote_databases_directory(args)])
os.remove('dbman_remote_metadata.json')
subprocess.run(['./upload_json.sh', get_local_databases_directory(args), 'dbman_remote_metadata.json', get_remote_databases_directory(args)])
os.remove(path_maker(get_local_databases_directory(args),'dbman_remote_metadata.json'))
def get_remote_filename(args, version):
......
#!/bin/bash
LOCAL_DATABASE_DIRECTORY=$1
LOCAL_FILE=$2
REMOTE_DATABASE_DIRECTORY=$3
cd $LOCAL_DATABASE_DIRECTORY
s3cmd put $LOCAL_FILE $REMOTE_DATABASE_DIRECTORY
cd -
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment