Software Público Brasileiro
Portal do

Software Público Brasileiro

  • Cadastre-se
  • Entrar
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Issues 29
  • Merge Requests 0
  • Wiki
  • noosfero
  • script
  • whenever
  • 348b6cb5   Fixes whenever in production for a multitenancy setup ... Browse Code »
    1
      Each cronjob has to run for all environments. I use `whenever --update-crontab`
      to append jobs for each environment, using the environment name as a
      whenever identifier, and then I have to clean the crontab of each
      environment generated jobs using the same identifier.
    Larissa Reis
    2015-11-10 16:47:58 -0300  
whenever 348 Bytes
Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#!/bin/sh

ACTION="$1"
ENV="$2"
if [ -z "$ENV" ]; then
  ENV='production'
fi

do_start(){
  bundle exec whenever --update-crontab $ENV --set "environment=$ENV"
}

do_stop(){
  bundle exec whenever --clear-crontab $ENV
}
case "$ACTION" in
  start|stop)
    do_$ACTION
    ;;
  *)
    echo "usage: $0 start|stop [environment]"
    exit 1
    ;;
esac
Voltar para o topo
Assuntos
Publique seu software
Prestadores de serviço
Espaços dos municípios
Software Público
Entenda o que é
Eventos
Prêmios
Publicações
Serviços
FAQ
Contato
Relatar erros
RSS
O que é?
Assine
Navegação
Acessibilidade
Mapa do site

Desenvolvido com os projetos de software livre Colab, Gitlab, Mailman e Noosfero