-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from grand-mother/dev_database
Dev database
- Loading branch information
Showing
14 changed files
with
603 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
aipTempDirectory=/sps/grand/prod_grand/tests/archivage/archs/gaa/ | ||
configMetadataDescriptiveDC=dc_gaa.xml | ||
configDocumentation=GRAND_DMP_2024.pdf | ||
representationID_1=representation1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
aipTempDirectory=/sps/grand/prod_grand/tests/archivage/archs/gp13/ | ||
configMetadataDescriptiveDC=dc_gp13.xml | ||
configDocumentation=GRAND_DMP_2024.pdf | ||
representationID_1=representation1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/bin/bash | ||
datadir="/sps/grand/data" | ||
archive_root_name="doi+10.25520+in2p3.archive.grand" | ||
irods_path='/grand/home/trirods/data/archives/' | ||
|
||
usage="$(basename "$0") [-d DATE] [-s SITE] [ | ||
Archive some Grand raw files into irods : | ||
-s site (gaa, gp13) | ||
-d YYYY-MM to be archived | ||
" | ||
|
||
while getopts "d:s:" option ${args}; do | ||
case $option in | ||
d) | ||
if [[ ${OPTARG} =~ ^([0-9]{4})-([0][1-9]|[1][0-2]|[1-9])$ ]]; then | ||
date=$(date --date="${BASH_REMATCH[1]}-${BASH_REMATCH[2]}-01" "+%Y_%m") | ||
dir=$(date --date="${BASH_REMATCH[1]}-${BASH_REMATCH[2]}-01" "+%Y/%m") | ||
else | ||
echo "Date ${OPTARG} should be in format YYYY-MM" | ||
exit 1 | ||
fi | ||
;; | ||
s) | ||
if [[ ${OPTARG} =~ gp13|gaa ]] ; then | ||
site=${OPTARG} | ||
else | ||
echo "Site should be gp13 or gaa" | ||
exit 1 | ||
fi | ||
;; | ||
:) | ||
printf "option -${OPTARG} need an argument\n" | ||
exit 1;; | ||
?) # Invalid option | ||
printf "Error: Invalid option -${OPTARG}\n" | ||
exit 1;; | ||
esac | ||
done | ||
|
||
if [ ! "$date" ] || [ ! "$site" ]; then | ||
echo "arguments -d and -s must be provided" | ||
echo "$usage" >&2; exit 1 | ||
fi | ||
|
||
outfile="${archive_root_name}.${site}.${date}" | ||
logfile=archs/${site}/${outfile}--$(date "+%Y_%m_%d_%H%M%S").log | ||
|
||
find $datadir/$site/raw/$dir/ -name "*.bin" >list_files_${site} | ||
echo "List of files to archive :" >> ${logfile} | ||
cat list_files_${site} >> ${logfile} | ||
|
||
java -jar createAIP.jar --configfile=config.properties.${site} --listobjects=list_files_${site} -i ${outfile} | ||
|
||
echo "Archive ready to tar" >> ${logfile} | ||
|
||
tar -cvf archs/${site}/${outfile}.tar archs/${site}/${outfile} | ||
|
||
echo "Archive tared" >> ${logfile} | ||
|
||
echo "Push archs/${site}/${outfile}.tar to irods" >> ${logfile} | ||
# Put file into irods | ||
sfile=archs/${site}/${outfile}.tar | ||
ipath="${irods_path}${site}/raw" | ||
ifile="${ipath}/${outfile}.tar" | ||
echo "imkdir -p $ipath" >> ${logfile} | ||
imkdir -p $ipath >> ${logfile} 2>&1 | ||
echo "iput -f $sfile $ifile" >> ${logfile} | ||
#iput -f $sfile $ifile >> ${logfile} 2>&1 | ||
#iput_status=$? | ||
#if [ "$iput_status" -ne 0 ]; then | ||
# notify=1 | ||
#fi | ||
|
||
rm -rf archs/${site}/${outfile} | ||
rm $sfile | ||
echo "Month archived.">> ${logfile} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<resource xmlns="http://datacite.org/schema/kernel-4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.4/metadata.xsd"> | ||
<identifier> | ||
<identifier identifierType="DOI">doi+10.25520+in2p3.archive+grand+gaa</identifier> | ||
</identifier> | ||
<titles> | ||
<title xml:lang="EN">Grand Raw Files from GAA</title> | ||
</titles> | ||
<creators> | ||
<creator> | ||
<creatorName nameType="Organizational">Grand Observatory</creatorName> | ||
<nameIdentifier>Grand Observatory</nameIdentifier> | ||
</creator> | ||
</creators> | ||
<publisher>Grand Observatory</publisher> | ||
<publicationYear>2024</publicationYear> | ||
<resourceType resourceTypeGeneral="Dataset">Grand raw files</resourceType> | ||
<descriptions> | ||
<description xml:lang="EN">Grand Raw Data from GAA Observatory</description> | ||
</descriptions> | ||
<subjects> | ||
<subject subjectScheme="wikidata">radio astronomy cosmics rays neutrinos</subject> | ||
</subjects> | ||
<dates> | ||
<date dateType="Copyrighted">2024</date> | ||
</dates> | ||
<geoLocations> | ||
<geoLocation> | ||
<geoLocationPlace>Argentina</geoLocationPlace> | ||
</geoLocation> | ||
</geoLocations> | ||
</resource> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<resource xmlns="http://datacite.org/schema/kernel-4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.4/metadata.xsd"> | ||
<identifier> | ||
<identifier identifierType="DOI">doi+10.25520+in2p3.archive+grand+gp13</identifier> | ||
</identifier> | ||
<titles> | ||
<title xml:lang="EN">Grand Raw Files from GP13</title> | ||
</titles> | ||
<creators> | ||
<creator> | ||
<creatorName nameType="Organizational">Grand Observatory</creatorName> | ||
<nameIdentifier>Grand Observatory</nameIdentifier> | ||
</creator> | ||
</creators> | ||
<publisher>Grand Observatory</publisher> | ||
<publicationYear>2024</publicationYear> | ||
<resourceType resourceTypeGeneral="Dataset">Grand raw files</resourceType> | ||
<descriptions> | ||
<description xml:lang="EN">Grand Raw Data from GP13 Observatory</description> | ||
</descriptions> | ||
<subjects> | ||
<subject subjectScheme="wikidata">radio astronomy cosmics rays neutrinos</subject> | ||
</subjects> | ||
<dates> | ||
<date dateType="Copyrighted">2024</date> | ||
</dates> | ||
<geoLocations> | ||
<geoLocation> | ||
<geoLocationPlace>China</geoLocationPlace> | ||
</geoLocation> | ||
</geoLocations> | ||
</resource> |
Oops, something went wrong.