Index: /tools/project_repository_sync
===================================================================
--- /tools/project_repository_sync	(revision 299)
+++ /tools/project_repository_sync	(revision 300)
@@ -9,6 +9,8 @@
 usage () {
     echo "usage: $(basename $0) [-all|project]"
+    exit 1
 }
 
+global_status=0
 projects=''
 while [ -n "$(echo $1 | grep '^-')" ]
@@ -65,7 +67,15 @@
         repo_name=$(echo ${repo_line} | awk '{print $1}')
         echo "    Syncing repository ${repo_name}"
-        trac-admin ${project_path} repository sync ${repo_name} 
+        trac-admin ${project_path} repository sync ${repo_name}
+        status=$?
+        if [ ${status} -ne 0 ]
+        then
+            echo "    An error occured syncing ${repo_name}"
+            global_status=${status}
+        fi
     done
 done
 
 IFS=${save_ifs}
+
+exit ${global_status}
Index: /tools/trac_backup
===================================================================
--- /tools/trac_backup	(revision 299)
+++ /tools/trac_backup	(revision 300)
@@ -5,13 +5,14 @@
 # Written by Michel Jouvin - CNRS/LAL - 15/7/2019
 
-backup_host=tracsrv2
+backup_host=tracsrv2.lal.in2p3.fr
 backup_directory=/wwwmirror/trac-backup
 trac_projects=/pdisk/trac/projects
 backup_ssh_key=/pdisk/trac/site-config/ssh/trac_backup_rsa
+backup_ssh_known_hosts=/pdisk/trac/site-config/ssh/trac_known_hosts
+rsync_ssh_cmd="ssh -i ${backup_ssh_key} -o UserKnownHostsFile=${backup_ssh_known_hosts}"
 
-echo "Syncing Trac projects (${trac_projects}) to ${backup_directory} on ${backup_host}"
-eval `ssh-agent`
-ssh-add ${backup_ssh_key}
-rsync -a ${trac_projects}/* ${backup_host}:${backup_directory}
-ssh-add -d ${backup_ssh_key}
+echo "$(date --iso-8601=seconds) - Syncing Trac projects (${trac_projects}) to ${backup_directory} on ${backup_host}"
+rsync -a --rsh "${rsync_ssh_cmd}" ${trac_projects}/* ${backup_host}:${backup_directory}
 
+echo "$(date --iso-8601=seconds) - Syncing of Trac projects completed"
+
Index: /tools/update_mirrors_sync_repos
===================================================================
--- /tools/update_mirrors_sync_repos	(revision 300)
+++ /tools/update_mirrors_sync_repos	(revision 300)
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+update_svn_mirrors_log=/tmp/update_svn_mirrors.log
+project_repository_sync_log=/tmp/project_repository_sync.log
+
+echo "$(date --iso-8601=seconds) - SVN mirror update and Trac synchronisation starting..."
+
+/pdisk/trac/site-config/tools/update_svn_mirrors -all >& ${update_svn_mirrors_log}
+if [ $? -eq 0 ]
+then
+    echo "Update of SVN mirrors completed successfully"
+else
+    echo "WARNING: some errors occured during the update of SVN mirrors. See ${update_svn_mirrors_log}"
+fi
+
+/pdisk/trac/site-config/tools/project_repository_sync -all >& ${project_repository_sync_log}
+if [ $? -eq 0 ]
+then
+    echo "Sync of project repositories completed successfully"
+else
+    echo "WARNING: some errors occured during sync of project reprositories. See ${project_repository_sync_log}"
+fi
+
+echo "$(date --iso-8601=seconds) - SVN mirror update and Trac synchronisation completed"
Index: /tools/update_svn_mirrors
===================================================================
--- /tools/update_svn_mirrors	(revision 299)
+++ /tools/update_svn_mirrors	(revision 300)
@@ -8,4 +8,5 @@
 source_svn_server="svn+ssh://root@svn.lal.in2p3.fr"
 source_svn_root=/wwwdata/subversion
+backup_ssh_key=/pdisk/trac/site-config/ssh/trac_backup_rsa
 pre_revprop_change_hook_path=hooks/pre-revprop-change
 
@@ -35,6 +36,10 @@
     echo ""
     echo "repository: repository path relative to ${source_svn_root} or ${svn_mirrors_root}"
+
+    exit 1
 }
 
+
+global_status=0
 svn_repos_list=''
 while [ -n "$(echo $1 | grep '^-')" ]
@@ -75,4 +80,7 @@
 fi
 
+eval $(ssh-agent)
+ssh-add ${backup_ssh_key}
+
 for repo_db_path in ${svn_repos_list}
 do
@@ -91,9 +99,18 @@
 
     svnsync synchronize file:///${repo_path} ${source_svn_server}${source_svn_root}/${repo_name}
-    if [ $? -eq 0 ]
+    status=$?
+    if [ ${status} -eq 0 ]
     then
         echo "    Repository ${repo_name} synchronisation done successfully"
     else
         echo "    ERROR: an error occurred during repository ${repo_name} synchronisation"
+        global_status=${status}
     fi
 done
+
+if [ -n ${SSH_AGENT_PID} ]
+then
+    kill -TERM ${SSH_AGENT_PID}
+fi
+
+exit ${global_status}
