sfwebcron 927 B

123456789101112131415161718192021222324252627282930313233343536
  1. #! /bin/bash
  2. # sfwebcron
  3. # To update the developers-guidelines.html and put in html area
  4. #
  5. # Install in cron with something like:
  6. # 47 7 * * * $HOME/bin/sfwebcron >/tmp/sfwebcron.log 2>&1 || cat /tmp/sfwebcron.log
  7. set -eu
  8. trap 'echo "Command failed at line $LINENO"' ERR
  9. # Set working variables
  10. PROJECT=nagiosplug
  11. IN=${HOME}/sfwebcron
  12. OUT_SERVER="tonvoon@frs.sourceforge.net"
  13. OUT_PATH="/home/groups/n/na/nagiosplug/htdocs"
  14. if [[ ! -e developer-guidelines.html.last ]] ; then
  15. touch developer-guidelines.html.last
  16. fi
  17. # Get latest dev guildelines
  18. [[ ! -d $IN ]] && mkdir $IN
  19. cd $IN
  20. if [[ ! -d nagios-plugins ]] ; then
  21. git clone https://github.com/nagios-plugins/nagios-plugins.git nagios-plugins
  22. fi
  23. cd nagios-plugins/doc
  24. git pull
  25. make
  26. if [[ developer-guidelines.html -nt developer-guidelines.html.last ]] ; then
  27. rsync -av developer-guidelines.{html,sgml} $OUT_SERVER:$OUT_PATH/
  28. touch developer-guidelines.html.last
  29. fi