Corrected cron file format
This commit is contained in:
@@ -24,6 +24,8 @@ tail -6 ${RAW_DATA} > ${TMP_DATA} && \
|
|||||||
tail -1000 ${RAW_DATA} > ${TMP_DATA} && \
|
tail -1000 ${RAW_DATA} > ${TMP_DATA} && \
|
||||||
cp ${TMP_DATA} ${RAW_DATA}
|
cp ${TMP_DATA} ${RAW_DATA}
|
||||||
|
|
||||||
|
echo "[$(date)] Updated speed data"
|
||||||
|
|
||||||
# Above arguments produce the following output in single line. Expanded for readability below:
|
# Above arguments produce the following output in single line. Expanded for readability below:
|
||||||
#
|
#
|
||||||
# {
|
# {
|
||||||
|
|||||||
6
start.sh
6
start.sh
@@ -18,14 +18,14 @@ chmod -R a+rwX /var/www/data || true
|
|||||||
|
|
||||||
# Run the initial speed test once (in background) to populate files if possible
|
# Run the initial speed test once (in background) to populate files if possible
|
||||||
# We run it in background so server starts promptly. The cron will run hourly.
|
# We run it in background so server starts promptly. The cron will run hourly.
|
||||||
/usr/local/bin/run_speed_test.sh || true &
|
/usr/local/bin/run_speed_test.sh >> /var/log/cron.log 2>&1 || true &
|
||||||
|
|
||||||
# Ensure the cron job exists in Cron
|
# Ensure the cron job exists in Cron
|
||||||
CRON_FILE=/etc/cron.d/speedtest-cron
|
CRON_FILE=/etc/cron.d/speedtest-cron
|
||||||
if grep run_speed_test ${CRON_FILE}; then
|
if [ -f ${CRON_FILE} ] && grep run_speed_test ${CRON_FILE}; then
|
||||||
echo "cron entry already present"
|
echo "cron entry already present"
|
||||||
else
|
else
|
||||||
echo ${CRON_MINUTE} '* * * * /usr/local/bin/run_speed_test.sh >> /var/log/cron.log 2>&1' > ${CRON_FILE}
|
echo ${CRON_MINUTE} '* * * * root /usr/local/bin/run_speed_test.sh >> /var/log/cron.log 2>&1' > ${CRON_FILE}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start Debian cron in background
|
# Start Debian cron in background
|
||||||
|
|||||||
Reference in New Issue
Block a user