sfwebcron 835 B

1234567891011121314151617181920212223242526272829303132333435
  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. PROBE="developer-guidelines.html.last"
  13. OUT_SERVER="tonvoon@frs.sourceforge.net"
  14. OUT_PATH="/home/groups/n/na/nagiosplug/htdocs"
  15. # Get latest dev guildelines
  16. [[ ! -d $IN ]] && mkdir $IN
  17. cd $IN
  18. if [[ ! -d nagios-plugins ]]
  19. then
  20. git clone https://github.com/nagios-plugins/nagios-plugins.git nagios-plugins
  21. fi
  22. cd nagios-plugins/doc
  23. git pull
  24. make
  25. if [[ ! -e $PROBE || developer-guidelines.html -nt $PROBE ]]
  26. then
  27. rsync -av developer-guidelines.{html,sgml} $OUT_SERVER:$OUT_PATH/
  28. touch $PROBE
  29. fi