Commit d15c6c3f authored by Julian Brost's avatar Julian Brost
Browse files

create tempfiles in output directory

otherwise move isn't atomic if /tmp is a different filesystem
parent 2fa869d5
......@@ -11,8 +11,8 @@ url() {
}
fetch() {
t=`mktemp`
curl --silent -H 'X-Remote-User: nobody' "$(url "$1")" > $t
t=$(mktemp -p "$OUTDIR")
curl --silent -H 'X-Remote-User: nobody' "$(url "$1")" > "$t"
mv $t "${OUTDIR}/${2}.png"
}
......
......@@ -6,7 +6,7 @@ OUTDIR=/var/www/temperature
IMPORTFROM="https://cipmon.informatik.uni-erlangen.de/temperature"
for thing in day week month year; do
t=`mktemp`
curl --silent "${IMPORTFROM}/${thing}.png" > $t
t=$(mktemp -p "$OUTDIR")
curl --silent "${IMPORTFROM}/${thing}.png" > "$t"
mv $t "${OUTDIR}/${thing}.png"
done
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment