diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-03-01 20:23:04 -0500 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-03-01 20:23:04 -0500 |
commit | 1b52d03f22f9ce224ee8355fe4489c326d19820c (patch) | |
tree | bbf1c5426dcb20ddf3891a0710feab51d3c194aa /cron | |
parent | bac35fb088833fdc757c8dc9e90bcb53a0a8755c (diff) | |
download | askbot-1b52d03f22f9ce224ee8355fe4489c326d19820c.tar.gz askbot-1b52d03f22f9ce224ee8355fe4489c326d19820c.tar.bz2 askbot-1b52d03f22f9ce224ee8355fe4489c326d19820c.zip |
fixed the cron job files and added README for cron directory
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 | 11 | ||||
-rwxr-xr-x | cron/once_award_badges_virtualenv | 10 | ||||
-rw-r--r-- | cron/send_email_alerts | 7 |
6 files changed, 35 insertions, 19 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..79d02f61 100755 --- a/cron/once_award_badges +++ b/cron/once_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 once_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1 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 |