Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- BASE_DIR=/path/to/base
- SCRIPT=$BASE_DIR/scripts/loadwatcher.php
- PID_FILE=/var/run/loadwatcher.pid
- EMAIL=btmash@gmail.com
- # If there is an old process, kill it
- kill `cat $PID_FILE`
- # Make sure the file is clean
- rm -f $PID_FILE
- cd $BASE_DIR
- nohup php $SCRIPT > /dev/null &
- PID=$!
- echo $PID > $PID_FILE
Add Comment
Please, Sign In to add comment