-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Activate the environment for virt. env. cronjobs
- Loading branch information
1 parent
01105c1
commit db6b594
Showing
1 changed file
with
6 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -332,11 +332,14 @@ set_cronjob() { | |
# Avoid -u parameter when using the OS crontab | ||
_is_venv && crontabParams="" || crontabParams="-u $WMA_USER" | ||
|
||
# Activate the environment if cronjobs are to run under virtual env | ||
_is_venv && crontabEnvStr="source $WMA_ROOT_DIR/bin/activate > /dev/null && " || crontabEnvStr="" | ||
|
||
# Populating proxy related cronjobs | ||
crontab $crontabParams - <<EOF | ||
55 */12 * * * date -Im >> $WMA_LOG_DIR/renew-proxy.log && $WMA_MANAGE_DIR/manage renew-proxy 2>&1 >> $WMA_LOG_DIR/renew-proxy.log | ||
58 */12 * * * python $WMA_DEPLOY_DIR/deploy/checkProxy.py --proxy $X509_USER_PROXY --time 120 --send-mail True --mail [email protected] | ||
*/15 * * * * source $WMA_DEPLOY_DIR/deploy/restartComponent.sh 2>&1 >> $WMA_LOG_DIR/component-restart.log | ||
55 */12 * * * $crontabEnvStr date -Im >> $WMA_LOG_DIR/renew-proxy.log && $WMA_MANAGE_DIR/manage renew-proxy 2>&1 >> $WMA_LOG_DIR/renew-proxy.log | ||
58 */12 * * * $crontabEnvStr python $WMA_DEPLOY_DIR/deploy/checkProxy.py --proxy $X509_USER_PROXY --time 120 --send-mail True --mail [email protected] | ||
*/15 * * * * $crontabEnvStr source $WMA_DEPLOY_DIR/deploy/restartComponent.sh 2>&1 >> $WMA_LOG_DIR/component-restart.log | ||
EOF | ||
let errVal+=$? | ||
|
||
|