Issue Details (XML | Word | Printable)

Key: MBS-4341
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Normal Normal
Assignee: Kuno Woudt
Reporter: Ian McEwen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
MusicBrainz Server

cron scripts don't account for carton

Created: 19/Feb/12 11:01 PM   Updated: 14/Jun/12 09:45 AM   Resolved: 14/Jun/12 09:45 AM
Component/s: Scripts
Affects Version/s: Bug fixes, 2012-02-06
Fix Version/s: Bug fixes, 2012-06-25


 Description  « Hide

hourly, daily, and weekly scripts just try to run the relevant admin scripts directly, rather than using carton exec

Munger from IRC solved this problem with a little wrapper script: http://paste.pocoo.org/show/553669/



Sort Order: Ascending order - Click to sort in descending order
Tim Hosking added a comment - 20/Feb/12 12:50 AM

I'm using this to start/stop the server and call the cron scripts :-
=======

#!/bin/bash

CARTON=$(which carton)
[ -x "${CARTON}" ] || exit 1

LOG=/var/log/musicbrainz
PIDFILE=$HOME/MusicBrainz.pid

cd $HOME/musicbrainz-server

case "$1" in

start)
if [ -f "${PIDFILE}" ]; then
echo "${PIDFILE}" exists. Is the server already running?
exit 1
fi
$CARTON exec – plackup -Ilib -r >> $LOG/server.log 2>&1 &
PID=$!
echo $PID > "${PIDFILE}"
echo "Server started with PID=$PID"
;;

stop)
if [ -f "${PIDFILE}" ]; then
PID=$(cat "${PIDFILE}")
kill $PID
rm "${PIDFILE}"
echo "Server stopped."
else
echo "Can't find ${PIDFILE}. Is the server running?"
fi
;;

hourly)
$CARTON exec – ./admin/cron/hourly.sh >> $LOG/hourly.log 2>&1
;;

daily)
$CARTON exec – ./admin/cron/daily.sh >> $LOG/daily.log 2>&1
;;

weekly)
$CARTON exec – ./admin/cron/weekly.sh >> $LOG/weekly.log 2>&1
;;

*)
echo $"Usage: $0 {start|stop|hourly|daily|weekly}"
exit 1
esac

exit 0


Oliver Charles added a comment - 14/Jun/12 09:45 AM

We now use Carton in cron jobs