Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maalepaaler
atlas-trace
Commits
cb0fc5d1
Commit
cb0fc5d1
authored
Jan 25, 2022
by
Olav Kvittem
Browse files
added check for load
parent
98013462
Changes
1
Hide whitespace changes
Inline
Side-by-side
atlas-gap-ana
View file @
cb0fc5d1
#!/bin/bash
#Starts analyzing 24 hours of files
#Correct input is ./atlas-gap
-
ana 2021-03-05
#Correct input is ./atlas-gap
_
ana 2021-03-05
#if you want that particular date
SCRIPT_DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&> /dev/null
&&
pwd
)
"
maxload
=
$(
lscpu |
awk
'/^CPU\(s\)/{print $2;exit 0}'
)
check_load
(){
load
=
$(
awk
'{printf "%d",$1}'
/proc/loadavg
)
while
test
$load
-gt
$maxload
;
do
date
"+%T slowdown with
$njobs
jobs and
$load
load"
sleep
60
# for all detached jobs to finish
load
=
$(
awk
'{printf "%d",$1}'
/proc/loadavg
)
done
}
#Checks to see if files are already downloaded or loaded
if
[
-f
"log/
$1
-loaded"
]
;
then
exit
then
exit
fi
if
[
-f
"log/
$1T0000
-finished"
]
;
then
exit
then
exit
fi
#Checks to see if files are ready on RIPE Atlas server
#Checks to see if files are on RIPE Atlas server
for
i
in
{
0..23
}
do
if
[
$i
-lt
10
]
then
j
=
0
${
i
}
j
=
0
${
i
}
else
j
=
${
i
}
fi
if
!
wget
--spider
\
"https://data-store.ripe.net/datasets/atlas-daily-dumps/
${
1
}
/traceroute-
${
1
}
T
${
j
}
00.bz2"
\
2>/dev/null
;
2>/dev/null
;
then
exit
fi
...
...
@@ -47,6 +55,6 @@ do
else
j
=
${
i
}
fi
python
$SCRIPT_DIR
/
atlas-gap-ana.py
${
1
}
T
${
j
}
00 &
check_load
nice
python atlas-gap-ana.py
${
1
}
T
${
j
}
00 &
done
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment