SVN autoupdates: Difference between revisions

From Skytech
Jump to navigation Jump to search
No edit summary
 
Line 42: Line 42:
int main(void)
int main(void)
{
{
execl("/usr/bin/svn", "svn", "update", "/DATA/www/crap2/Oxen2",
execl("/usr/bin/svn", "svn", "update", "/DATA/www/test",
(const char *) NULL);
(const char *) NULL);
return(EXIT_FAILURE);
return(EXIT_FAILURE);
}
}
</pre>
</pre>

= Compile it =
= Compile it =
<pre>
<pre>

Latest revision as of 10:11, 28 February 2008


Things for bach_profile file

# .bash_profile

# disable Ctrl-C
function my_ctrlc_handler() {
echo "Ctrl-C trapped."
echo "Please use 'kill -9 $$' to end this script."
}
trap "my_ctrlc_handler" 2 # Ctrl-C gives signal 2

# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME

SSHAGENT=/usr/bin/ssh-agent
SSHAGENTARGS="-s"
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
   eval `$SSHAGENT $SSHAGENTARGS`
   trap "kill $SSH_AGENT_PID" 0
fi
SSHADD=/usr/bin/ssh-add
`$SSHADD /var/www/.ssh/id_rsa`

echo "Updating test site"
OUT=`/var/www/bin/apache-svn`
echo $OUT

logout

c program to update of svn

eidt /var/www/bin/apache-svn.c Change the last variable execl to point to the approtiate directory

#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
int main(void)
{
  execl("/usr/bin/svn", "svn", "update", "/DATA/www/test",
        (const char *) NULL);
  return(EXIT_FAILURE);
}

Compile it

gcc /var/www/bin/apache-svn.c -o /var/www/bin/apache-svn-[svn-projekt]