diff options
Diffstat (limited to 'cron')
-rw-r--r-- | cron/README | 5 | ||||
-rwxr-xr-x | cron/multi_award_badges | 11 | ||||
-rwxr-xr-x | cron/multi_award_badges_virtualenv | 10 | ||||
-rwxr-xr-x | cron/once_award_badges | 18 | ||||
-rwxr-xr-x | cron/once_award_badges_virtualenv | 10 | ||||
-rw-r--r-- | cron/send_email_alerts | 7 |
6 files changed, 43 insertions, 18 deletions
diff --git a/cron/README b/cron/README new file mode 100644 index 00000000..d5573150 --- /dev/null +++ b/cron/README @@ -0,0 +1,5 @@ +this directory contains sample commands to be executed +by cron + +files with names ending "virtuanenv" should work under Python virtualenv system +other files - with standard unix setup diff --git a/cron/multi_award_badges b/cron/multi_award_badges index df58155a..b34abd09 100755 --- a/cron/multi_award_badges +++ b/cron/multi_award_badges @@ -1,10 +1,5 @@ #!/bin/sh - -WORKON_HOME=~/envs/osqa -PROJECT_ROOT=~/webapps/osqa_server/projects/osqa/ - -# activate virtual environment -. $WORKON_HOME/bin/activate - -cd $PROJECT_ROOT +PYTHONPATH=/path/to/dir_above_osqa_site +export PYTHONPATH +PROJECT_ROOT=$PYTHONPATH/osqa_site python manage.py multi_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1 diff --git a/cron/multi_award_badges_virtualenv b/cron/multi_award_badges_virtualenv new file mode 100755 index 00000000..df58155a --- /dev/null +++ b/cron/multi_award_badges_virtualenv @@ -0,0 +1,10 @@ +#!/bin/sh + +WORKON_HOME=~/envs/osqa +PROJECT_ROOT=~/webapps/osqa_server/projects/osqa/ + +# activate virtual environment +. $WORKON_HOME/bin/activate + +cd $PROJECT_ROOT +python manage.py multi_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1 diff --git a/cron/once_award_badges b/cron/once_award_badges index 12414969..43ee2249 100755 --- a/cron/once_award_badges +++ b/cron/once_award_badges @@ -1,10 +1,14 @@ #!/bin/sh +PYTHONPATH=/path/to/dir_above_osqa_site +export PYTHONPATH +PROJECT_ROOT=$PYTHONPATH/osqa_site +python manage.py once_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1 -WORKON_HOME=~/envs/osqa -PROJECT_ROOT=~/webapps/osqa_server/projects/osqa/ - -# activate virtual environment -. $WORKON_HOME/bin/activate -cd $PROJECT_ROOT -python manage.py once_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1 +#!/bin/sh +PYTHONPATH=/usr/local/sites/osqa_production +export PYTHONPATH +PROJECT_ROOT=$PYTHONPATH/robofaqs +python $PROJECT_ROOT/manage.py once_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1 +python $PROJECT_ROOT/manage.py multi_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1 +python $PROJECT_ROOT/manage.py send_email_alerts >> $PROJECT_ROOT/log/cron_email.log 2>&1
\ No newline at end of file diff --git a/cron/once_award_badges_virtualenv b/cron/once_award_badges_virtualenv new file mode 100755 index 00000000..12414969 --- /dev/null +++ b/cron/once_award_badges_virtualenv @@ -0,0 +1,10 @@ +#!/bin/sh + +WORKON_HOME=~/envs/osqa +PROJECT_ROOT=~/webapps/osqa_server/projects/osqa/ + +# activate virtual environment +. $WORKON_HOME/bin/activate + +cd $PROJECT_ROOT +python manage.py once_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1 diff --git a/cron/send_email_alerts b/cron/send_email_alerts index 6358b599..cae09606 100644 --- a/cron/send_email_alerts +++ b/cron/send_email_alerts @@ -1,4 +1,5 @@ -PYTHONPATH=/path/to/dir/above/forum +#!/bin/sh +PYTHONPATH=/path/to/dir_above_osqa_site export PYTHONPATH -APP_ROOT=$PYTHONPATH/nmr-forum2 -/path/to/python $APP_ROOT/manage.py send_email_alerts +PROJECT_ROOT=$PYTHONPATH/osqa_site +/path/to/python $PROJECT_ROOT/manage.py send_email_alerts |