-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeamon_jgi.sh
More file actions
executable file
·52 lines (41 loc) · 1.57 KB
/
deamon_jgi.sh
File metadata and controls
executable file
·52 lines (41 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
########################################################################################
# script name: daemon_mgnify_markergne.sh
# developed by: Haris Zafeiropoulos
# framework: PREGO - WP2
########################################################################################
# GOAL:
# This script is intented to run few months with a cron job in order to update the
# knowledge module of the PREGO knowledgebase to include the new genome and metagenome
# entries of the JGI/IMG platform
########################################################################################
# Start time of this robot
echo $date
# Get the date of the update
version=$(date +'%Y_%m_%d')
jgi_data_directory='/data/databases/jgi/'
scripts_directory='/data/databases/scripts/gathering_data/jgi/'
experiments_path='/data/experiments/'
knowledge_path='/data/knowledge/'
# Archive previous version
cd $jgi_data_directory
tar cvzf jgi_$version.tar.gz .
mv jgi_$version.tar.gz /data/archives/jgi
# Run script to export associations
cd $scripts_directory
./extract_jgi_isolates_associations.py
# Keep unique entries
cd $experiments_path
sort -u jgi_associations.tsv > tmp
mv tmp jgi_associations.tsv
cd $knowledge_path
sort -u jgi_associations.tsv > tmp
mv tmp jgi_associations.tsv
# Check if everything in downloading the new entries of JGI/IMG ran Ok.
# If an error occurred, then exit the script (keeping the previous version of markergene data)
last_task_return_code=$?
if [ $last_task_return_code -ne 0 ]; then
echo ERROR $last_task_return_code
echo $date
exit $last_task_return_code
fi