Category Archives: jabber

be notified of all svn changes

If you want like me have been notified of all svn changes, the following script I wrote for you.

Prerequisite :

  • svn installed
  • svn well configured for user executing script


export SVN_UPDATES_HOME=/mnt/scripts/svnUpdates
export SVN_UPDATES_LAST=$SVN_UPDATES_HOME/tmp/svnUpdatesLast.txt
export SVN_UPDATES_TMP=$SVN_UPDATES_HOME/tmp/svnUpdates.txt
export SVN_UPDATES_DIFF_TMP=$SVN_UPDATES_HOME/tmp/svnUpdatesDiff.txt

if [[ -s $SVN_UPDATES_LAST ]]
  echo “copy last svn log to tmp”

for log in 1 2 3
  echo “svn log – try:$log”
  svn log -v -l5 -rHEAD:1 > $SVN_UPDATES_LAST
  if [[ -s $SVN_UPDATES_LAST ]]
    echo “svn logged successfully in try:$log”

if [[ -s $SVN_UPDATES_LAST ]]
  echo “proceed to diff last with tmp”
  diff $SVN_UPDATES_LAST $SVN_UPDATES_TMP | grep -E “^<" | sed s/^.// > $SVN_UPDATES_DIFF_TMP
  diffsCount=$(wc -l $SVN_UPDATES_DIFF_TMP | awk {‘print $1’})
  if [ $diffsCount -gt 0 ]
      “diffs found: send notification”
      datetime=$(date “+%Y%m%d-%H%M%S”)
      cp $SVN_UPDATES_DIFF_TMP $logFile
      ### put here the way you want be notified (mail, jabber, …)
      ### echo “==== svn updated cf. $logFile ====” | sendxmpp
      ### cat $logFile | sendxmpp

Here I choose to be notified by message sent from jabber server from my account to my account.
Prerequisite : sendxmpp installed : apt-get install sendxmpp

echo “==== svn updated cf. $logFile ====” | sendxmpp
cat $logFile | sendxmpp

Finally, schedule the script in your crontab (executed each minute recommanded)

* * * * * /mnt/scripts/svnUpdates/

sendxmpp : send jabber message with command line

April 8, 2013

sendxmpp : send jabber message with command line:
install sendxmpp ( : > sudo apt-get install sendxmpp
create user config file : > touch ~/.sendxmpprc
secure your configuration file :  > chmod 600 ~/.sendxmpprc
configure jabber account : > echo ‘; mypassword’ > ~/.sendxmpprc
send your first message : > exho “salut” | sendxmpp yourFriend@server