|
|
@ -6,21 +6,21 @@ echo "To kill script, use the following command:"
|
|
|
|
echo "kill -9 $processstartid"
|
|
|
|
echo "kill -9 $processstartid"
|
|
|
|
for (( ; ; )); do
|
|
|
|
for (( ; ; )); do
|
|
|
|
let i++
|
|
|
|
let i++
|
|
|
|
if [ ! -d "/config/extended/logs" ]; then
|
|
|
|
if [ ! -d "/config/logs" ]; then
|
|
|
|
mkdir -p "/config/extended/logs"
|
|
|
|
mkdir -p "/config/logs"
|
|
|
|
chmod 777 "/config/extended/logs"
|
|
|
|
chmod 777 "/config/logs"
|
|
|
|
chown abc:abc "/config/extended/logs"
|
|
|
|
chown abc:abc "/config/logs"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
bash /config/extended/scripts/download.sh 2>&1 | tee "/config/extended/logs/script_run_${i}_$(date +"%Y_%m_%d_%I_%M_%p").log" > /proc/1/fd/1 2>/proc/1/fd/2
|
|
|
|
bash /config/extended/scripts/download.sh 2>&1 | tee "/config/logs/extended_script_run_${i}_$(date +"%Y_%m_%d_%I_%M_%p").txt" > /proc/1/fd/1 2>/proc/1/fd/2
|
|
|
|
if [ -f "/config/extended/logs/log-cleanup" ]; then
|
|
|
|
if [ -f "/config/logs/log-cleanup" ]; then
|
|
|
|
rm "/config/extended/logs/log-cleanup"
|
|
|
|
rm "/config/logs/log-cleanup"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
touch -d "8 hours ago" "/config/extended/logs/log-cleanup"
|
|
|
|
touch -d "8 hours ago" "/config/logs/log-cleanup"
|
|
|
|
if find "/config/extended/logs" -type f -iname "*.log" -not -newer "/config/extended/logs/log-cleanup" | read; then
|
|
|
|
if find "/config/logs" -type f -iname "extended_script_run_*.txt" -not -newer "/config/extended/logs/log-cleanup" | read; then
|
|
|
|
find "/config/extended/logs" -type f -iname "*.log" -not -newer "/config/extended/logs/log-cleanup" -delete
|
|
|
|
find "/config/logs" -type f -iname "*.log" -not -newer "/config/logs/log-cleanup" -delete
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ -f "/config/extended/logs/log-cleanup" ]; then
|
|
|
|
if [ -f "/config/logs/log-cleanup" ]; then
|
|
|
|
rm "/config/extended/logs/log-cleanup"
|
|
|
|
rm "/config/logs/log-cleanup"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ -z "$scriptInterval" ]; then
|
|
|
|
if [ -z "$scriptInterval" ]; then
|
|
|
|
scriptInterval="15m"
|
|
|
|
scriptInterval="15m"
|
|
|
|