@@ -4,26 +4,27 @@ if [ `whoami` != 'root' ]; then
44 echo " ERROR: This script should only be run as root" >&2
55 exit 1
66fi
7- historialdir =' /srv/xdmod/historical'
8- if [ -f $historialdir /.hasrun ]; then
7+ historicaldir =' /srv/xdmod/historical'
8+ if [ -f $historicaldir /.hasrun ]; then
99 echo " ERROR: This has already been run once. Trying to do it again will cause errors" >&2
1010 exit 2
1111fi
12- touch $historialdir /.hasrun
13- jq --argfile f1 /etc/xdmod/resources.json --argfile f2 $historialdir /resources.json -n ' $f1 + $f2' | sudo tee /etc/xdmod/resources.json
14- jq --argfile f1 /etc/xdmod/resource_specs.json --argfile f2 $historialdir /resource_specs.json -n ' $f1 + $f2' | sudo tee /etc/xdmod/resource_specs.json
12+ touch $historicaldir /.hasrun
13+ tar -zxf $historicaldir /historical-data.tgz -C $historicaldir /
14+ jq --argfile f1 /etc/xdmod/resources.json --argfile f2 $historicaldir /resources.json -n ' $f1 + $f2' | sudo tee /etc/xdmod/resources.json
15+ jq --argfile f1 /etc/xdmod/resource_specs.json --argfile f2 $historicaldir /resource_specs.json -n ' $f1 + $f2' | sudo tee /etc/xdmod/resource_specs.json
1516types=' Cloud Jobs Storage'
16- for resource in $historialdir /Jobs/* .log; do
17+ for resource in $historicaldir /Jobs/* .log; do
1718 sudo -u xdmod xdmod-shredder -r ` basename $resource .log` -f slurm -i $resource ;
1819done
1920last_modified_start_date=$( date +' %F %T' )
20- sudo -u xdmod xdmod-shredder -r cumulonimbus -d $historialdir /Cloud/ -f openstack
21+ sudo -u xdmod xdmod-shredder -r cumulonimbus -d $historicaldir /Cloud/ -f openstack
2122sudo -u xdmod xdmod-ingestor --last-modified-start-date " $last_modified_start_date "
22- for storage_dir in $historialdir /Storage/* ; do
23+ for storage_dir in $historicaldir /Storage/* ; do
2324 sudo -u xdmod xdmod-shredder -f storage -r $( basename $storage_dir ) -d $storage_dir
2425done
2526last_modified_start_date=$( date +' %F %T' )
2627sudo -u xdmod xdmod-ingestor --datatype storage
27- cat names.slurm.csv names.csv > /tmp/historical.names.csv
28+ cat $historicaldir / names.slurm.csv $historicaldir / names.csv > /tmp/historical.names.csv
2829sudo -u xdmod xdmod-import-csv -t names -i /tmp/historical.names.csv
2930sudo -u xdmod xdmod-ingestor
0 commit comments