How to update svn working copy via a cron when svn server is located on local server

0

I have two servers. One of them has a svn server running and another hosting projects.

I have a daily cronjob updating the projects -- ie running svn update, rebuild etc.

Now, my cronjob on the remote server works. However, a similar cronjob running on the local server for local projects (ie the same server as svn) is instead displaying a "svn: not working copy".

I double checked the paths, permissions and user info and if the script is launched manually, it works fine. Deploying the same thing remotely works.

I even tried using file:/// (suggested here http://www.hightekhosting.com.au/myaccount/knowledgebase/90/Using-SubversionorSVN-on-cPanel-Servers.html) but still nothing.

Please advise,

Thanks,

-hbt

hbt

Posted 2010-08-03T15:18:20.993

Reputation: 1 371

Answers

1

It sounds like an environment difference between your local shell and the environment created by the cronjob.

Create this script in /tmp/env-test:

#!/bin/bash

env
echo $PATH
type -a svn
cd /path/to/local/workarea
svn info

Make it executable, run it manually then put it into cron with its output saved:

1  11  *  *  *  /tmp/env-test 2>1 >/tmp/cron-env

Compare the output of the local run and the cron version.

My hunch is that there's something different in your PATH.

Doug Harris

Posted 2010-08-03T15:18:20.993

Reputation: 23 578

Thank you! I exported the path to my cronjob and it worked. – hbt – 2010-08-03T16:08:39.393