Skip to content

Commit b68bfd6

Browse files
committed
typos, actually extract things
1 parent 731f1ef commit b68bfd6

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

xdmod/historical/add-historical.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,27 @@ if [ `whoami` != 'root' ]; then
44
echo "ERROR: This script should only be run as root" >&2
55
exit 1
66
fi
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
1111
fi
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
1516
types='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;
1819
done
1920
last_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
2122
sudo -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
2425
done
2526
last_modified_start_date=$(date +'%F %T')
2627
sudo -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
2829
sudo -u xdmod xdmod-import-csv -t names -i /tmp/historical.names.csv
2930
sudo -u xdmod xdmod-ingestor

0 commit comments

Comments
 (0)