Skip to content
Snippets Groups Projects

Deleted scripts/cron-run.sh

Merged gervasek requested to merge FPFISSUPP-16791 into master
2 files
+ 4
36
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 0
32
#!/bin/bash
FILE="/tmp/cron_disabled"
COMMAND_NAME='Drush cron'
DRUSH="$(which drush) --quiet --root=/var/www/html/ --uri=https://${VIRTUAL_HOST}"
cmd_executer () {
bash /scripts/cron.sh
}
timestamp () {
date +'[%d-%m-%Y %H:%M:%S]'
}
cmd_executer_logger () {
cmd_executer > >(sed "s/^/$(timestamp) INFO: ${SCRIPT_NAME} - /") 2> >(sed "s/^/$(timestamp) ERROR: ${SCRIPT_NAME} - /" >&2)
cmd_executer_exit_code=$?
sync
return $cmd_executer_exit_code
}
echo "$(timestamp) INFO: ${SCRIPT_NAME} started."
if [ -f "$FILE" ]; then
echo "$(timestamp) ERROR: ${SCRIPT_NAME} Cron disabled !"
else
if cmd_executer_logger; then
echo "$(timestamp) INFO: ${SCRIPT_NAME} stopped."
else
echo "$(timestamp) ERROR: ${SCRIPT_NAME} failed."
exit 1
fi
fi
\ No newline at end of file
Loading