Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've setup a git-svn repo with cron to fetch from the svn repo daily. I have a script to do the fetching, and this is what is invoked by cron. Everything is fine with the repo, and the script works fine when executed manually.

However, when it runs under cron, empty files get dropped into the .git directory. The files have names that look like they are some base64 output, e.g. juTrvjP6m8 and kcKf3hu3b4. Two of these files show up for every cron run. I thought these might be commit hashes, but they're not, git-show says it's an unknown revision.

I set-up the repo as follows:

git svn init http://svn.ip.addr/repo
git svn fetch svn-remote

My script looks like this:

cd /gitsvn/dir
git svn fetch svn-remote
git svn push pub

The last line pushes the repo to a separate (bare) public repo from which others can clone.

I'm piping the output from the cron job to a file, which looks like this:

fatal: unable to run 'git-svn'
Counting objects: 21, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (11/11), 59.08 KiB, done.
Total 11 (delta 8), reused 0 (delta 0)
To /gitpub/repo.git
   360faf5..a153b0d  trunk -> trunk

The line "fatal: unable to run 'git-svn'" is alarming, but the fetch seems to go ahead anyway. Any suggestions? Where are these empty garbage files coming from, and how to stop them? Am I in for bigger problems in the future?

BTW, I'm using git 1.6.3.3.

share|improve this question
add comment

1 Answer

I'm guessing something is missing from the environment variables when git-svn is run from cron. Have a look at this question: http://stackoverflow.com/questions/780072/why-does-my-command-line-not-run-from-cron

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.