# Problem involving Ruby, git and cron

**URL:** <https://www.ruby-forum.com/t/problem-involving-ruby-git-and-cron/165719>\
**Category:** Ruby\
**Created:** [April 16, 2009, 6:44pm UTC](https://www.ruby-forum.com/t/problem-involving-ruby-git-and-cron/165719 "2009-04-16T18:44:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![james-calivar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@james-calivar](https://www.ruby-forum.com/u/james-calivar)\
**Post date:** [April 16, 2009, 6:44pm UTC](https://www.ruby-forum.com/t/problem-involving-ruby-git-and-cron/165719/1 "2009-04-16T18:44:24Z")

</div>

Sorry to post this here, it’s really a combined Ruby/Linux/Git problem  
but  
I’m hoping someone here can point me in the right direction. I’ve  
written a  
Ruby script that exports all known branches of some git repos to static  
files, and optionally performs builds of JavaScript projects. It looks  
like  
this:

> <https://gist.github.com/96357>

To run: save this in a file, e.g. ~/widgets/export, make it executable  
and  
perform the following in the ~/widgets directory:

chmod +x export  
mkdir repos  
mkdir static  
cd repos  
git clone git://github.com/jcoglan/heist.git  
git clone git://github.com/jcoglan/js.class.git

Also, install these:

sudo gem install hoe grit jake

Then, go back to your home dir and run the script:

cd ~  
widgets/export

You should see a ton of stuff appear in the ‘static’ dir. Also notice  
that  
the contents of static/js.class/0.9.0 and static/js.class/2.0.0 (for  
example) are different. Next, set this script up to run under cron using  
‘crontab -e’ (First digit is the minutes past the hour the script will  
run.  
Replace my username with your own.)

crontab -e  
40 \* \* \* \* /home/jcoglan/widgets/export

Wait for the script to run, then inspect the directories again. All  
versions  
of js.class are now the same, whereas the heist versions are still  
distinct.  
Also, If I remove the heist repo, js.class exports correctly.

I’ve no idea why any of this should be the case: any help would be very  
gratefully received!
