SHARE
TWEET

cron.sh

a guest Mar 26th, 2015 243 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. # location of the php binary
  3. if [ ! "$1" = "" ] ; then
  4.     CRONSCRIPT=$1
  5. else
  6.     CRONSCRIPT=cron.php
  7. fi
  8.  
  9. MODE=""
  10. if [ ! "$2" = "" ] ; then
  11.         MODE=" $2"
  12. fi
  13.  
  14. PHP_BIN=`which php`
  15.  
  16. # absolute path to magento installation
  17. INSTALLDIR=`echo $0 | sed 's/cron\.sh//g'`
  18.  
  19. #       prepend the intallation path if not given an absolute path
  20. if [ "$INSTALLDIR" != "" -a "`expr index $CRONSCRIPT /`" != "1" ];then
  21.     if ! ps auxwww | grep "$INSTALLDIR$CRONSCRIPT$MODE" | grep -v grep 1>/dev/null 2>/dev/null ; then
  22.         $PHP_BIN $INSTALLDIR$CRONSCRIPT$MODE &
  23.     fi
  24. else
  25.     if  ! ps auxwww | grep "$CRONSCRIPT$MODE" | grep -v grep | grep -v cron.sh 1>/dev/null 2>/dev/null ; then
  26.         $PHP_BIN $CRONSCRIPT$MODE &
  27.     fi
  28. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top