git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cvsimport in cron
@ 2008-05-26 18:00 barrymac
  2008-05-26 23:13 ` Martin Langhoff
  0 siblings, 1 reply; 8+ messages in thread
From: barrymac @ 2008-05-26 18:00 UTC (permalink / raw)
  To: git


Hi All,

Apologies if this is a standard mistake, I'm not very experienced with cron. 
I'm trying to run cvsimport commands from within a cron job but it always
returns:
cvs: Connection refused
Use of uninitialized value in scalar chomp at /usr/bin/git-cvsimport line
349.
Use of uninitialized value in substitution (s///) at /usr/bin/git-cvsimport
line 350.
Expected Valid-requests from server, but got: <unknown>

I use ssh keys and have tested that they work  by using scp within the
script. The script goes as follows:

keychain /var/spool/gitosis/.ssh/id_rsa
. /var/spool/gitosis/.keychain/`uname -n`-sh

git-cvsimport -d :ext:barrym@cvs:/cvsroot -vio master CVSMODULE 

It would also be nice if someone could tell me also how to log the output. 

Thanks in advance,
Barry.

-- 
View this message in context: http://www.nabble.com/cvsimport-in-cron-tp17476529p17476529.html
Sent from the git mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cvsimport in cron
  2008-05-26 18:00 cvsimport in cron barrymac
@ 2008-05-26 23:13 ` Martin Langhoff
  2008-05-27 10:45   ` Barra Mac Mathúna
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Langhoff @ 2008-05-26 23:13 UTC (permalink / raw)
  To: barrymac; +Cc: git

On Tue, May 27, 2008 at 6:00 AM, barrymac <barrymac@gmail.com> wrote:
> Apologies if this is a standard mistake, I'm not very experienced with cron.
> I'm trying to run cvsimport commands from within a cron job but it always
> returns:

I've done this plenty, so it's known to work. Not sure why it's
failing in your case.

> I use ssh keys and have tested that they work  by using scp within the
> script. The script goes as follows:

That's a good start. Have you tried a cvs-over-ssh cvs operation from cron?

> It would also be nice if someone could tell me also how to log the output.

Just wrap the commandline in

  ( $cmd 2>&1) > /tmp/cvsimport.log

HTH, and tell us what the problem was - so the next one to bump into
it find the answer in the list ;-)

cheers,



m
-- 
 martin.langhoff@gmail.com
 martin@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cvsimport in cron
  2008-05-26 23:13 ` Martin Langhoff
@ 2008-05-27 10:45   ` Barra Mac Mathúna
  2008-05-27 11:08     ` Michael J Gruber
  2008-05-27 12:08     ` Barra Mac Mathúna
  0 siblings, 2 replies; 8+ messages in thread
From: Barra Mac Mathúna @ 2008-05-27 10:45 UTC (permalink / raw)
  To: Martin Langhoff; +Cc: git

Thanks Martin,

Nice to know how to log the progress! Good tip to try normal cvs over
ssh, which works fine.

I wish it was possible to get more verbose output from the git
cvsimport command. The connection refused error seems to me to be
misleading. I would expect at least some output from cvsps but it
doesn't even get to the first step.

So if everything works at the command line, what significant things
can be different in a cron job?

I also downgraded to the stable version according to gentoo, so I'm on
using 1.5.3.7 now, same result. Unfortunately I might have to give up
soon and ask developers to update their own repositories, as it's
burning up time.

Will post of course if I find the solution.

Thanks,
Barry.


On Tue, May 27, 2008 at 12:13 AM, Martin Langhoff
<martin.langhoff@gmail.com> wrote:
> On Tue, May 27, 2008 at 6:00 AM, barrymac <barrymac@gmail.com> wrote:
>> Apologies if this is a standard mistake, I'm not very experienced with cron.
>> I'm trying to run cvsimport commands from within a cron job but it always
>> returns:
>
> I've done this plenty, so it's known to work. Not sure why it's
> failing in your case.
>
>> I use ssh keys and have tested that they work  by using scp within the
>> script. The script goes as follows:
>
> That's a good start. Have you tried a cvs-over-ssh cvs operation from cron?
>
>> It would also be nice if someone could tell me also how to log the output.
>
> Just wrap the commandline in
>
>  ( $cmd 2>&1) > /tmp/cvsimport.log
>
> HTH, and tell us what the problem was - so the next one to bump into
> it find the answer in the list ;-)
>
> cheers,
>
>
>
> m
> --
>  martin.langhoff@gmail.com
>  martin@laptop.org -- School Server Architect
>  - ask interesting questions
>  - don't get distracted with shiny stuff - working code first
>  - http://wiki.laptop.org/go/User:Martinlanghoff
>



-- 
I must Create a System, or be enslaved by another Man's
Wm. Blake 1757 - 1827

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cvsimport in cron
  2008-05-27 10:45   ` Barra Mac Mathúna
@ 2008-05-27 11:08     ` Michael J Gruber
  2008-05-27 11:31       ` Martin Langhoff
  2008-05-27 13:33       ` John J. Franey
  2008-05-27 12:08     ` Barra Mac Mathúna
  1 sibling, 2 replies; 8+ messages in thread
From: Michael J Gruber @ 2008-05-27 11:08 UTC (permalink / raw)
  To: git

Barra Mac Mathúna venit, vidit, dixit 27.05.2008 12:45:
> Thanks Martin,
> 
> Nice to know how to log the progress! Good tip to try normal cvs over
> ssh, which works fine.
> 
> I wish it was possible to get more verbose output from the git
> cvsimport command. The connection refused error seems to me to be
> misleading. I would expect at least some output from cvsps but it
> doesn't even get to the first step.
> 
> So if everything works at the command line, what significant things
> can be different in a cron job?

The environment! Put "env" in your cron job and compare the output to 
"env" on the command line. cvs or cvsps may be in $PATH on the command 
line but not in cron, or $PERL5LIB might be different.

Cheers,
Michael

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cvsimport in cron
  2008-05-27 11:08     ` Michael J Gruber
@ 2008-05-27 11:31       ` Martin Langhoff
  2008-05-27 13:33       ` John J. Franey
  1 sibling, 0 replies; 8+ messages in thread
From: Martin Langhoff @ 2008-05-27 11:31 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git

On Tue, May 27, 2008 at 11:08 PM, Michael J Gruber
<michaeljgruber+gmane@fastmail.fm> wrote:
> The environment! Put "env" in your cron job and compare the output to "env"
> on the command line. cvs or cvsps may be in $PATH on the command line but
> not in cron, or $PERL5LIB might be different.

and perhaps $CVSROOT...


m
-- 
 martin.langhoff@gmail.com
 martin@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cvsimport in cron
  2008-05-27 10:45   ` Barra Mac Mathúna
  2008-05-27 11:08     ` Michael J Gruber
@ 2008-05-27 12:08     ` Barra Mac Mathúna
  1 sibling, 0 replies; 8+ messages in thread
From: Barra Mac Mathúna @ 2008-05-27 12:08 UTC (permalink / raw)
  To: git

I've also tried the command like this:

git-cvsimport p --no-cvs-direct -vio master CVSMODULE

Apparently cvsps has it's own client implementation, so I thought I'd
disable that in order to be more sure that it was working in the same
way as the normal cvs over ssh update that works fine in cron.

Barry.


On Tue, May 27, 2008 at 10:45 AM, Barra Mac Mathúna <barrymac@gmail.com> wrote:
> Thanks Martin,
>
> Nice to know how to log the progress! Good tip to try normal cvs over
> ssh, which works fine.
>
> I wish it was possible to get more verbose output from the git
> cvsimport command. The connection refused error seems to me to be
> misleading. I would expect at least some output from cvsps but it
> doesn't even get to the first step.
>
> So if everything works at the command line, what significant things
> can be different in a cron job?
>
> I also downgraded to the stable version according to gentoo, so I'm on
> using 1.5.3.7 now, same result. Unfortunately I might have to give up
> soon and ask developers to update their own repositories, as it's
> burning up time.
>
> Will post of course if I find the solution.
>
> Thanks,
> Barry.
>
>
> On Tue, May 27, 2008 at 12:13 AM, Martin Langhoff
> <martin.langhoff@gmail.com> wrote:
>> On Tue, May 27, 2008 at 6:00 AM, barrymac <barrymac@gmail.com> wrote:
>>> Apologies if this is a standard mistake, I'm not very experienced with cron.
>>> I'm trying to run cvsimport commands from within a cron job but it always
>>> returns:
>>
>> I've done this plenty, so it's known to work. Not sure why it's
>> failing in your case.
>>
>>> I use ssh keys and have tested that they work  by using scp within the
>>> script. The script goes as follows:
>>
>> That's a good start. Have you tried a cvs-over-ssh cvs operation from cron?
>>
>>> It would also be nice if someone could tell me also how to log the output.
>>
>> Just wrap the commandline in
>>
>>  ( $cmd 2>&1) > /tmp/cvsimport.log
>>
>> HTH, and tell us what the problem was - so the next one to bump into
>> it find the answer in the list ;-)
>>
>> cheers,
>>
>>
>>
>> m
>> --
>>  martin.langhoff@gmail.com
>>  martin@laptop.org -- School Server Architect
>>  - ask interesting questions
>>  - don't get distracted with shiny stuff - working code first
>>  - http://wiki.laptop.org/go/User:Martinlanghoff
>>
>
>
>
> --
> I must Create a System, or be enslaved by another Man's
> Wm. Blake 1757 - 1827
>



-- 
I must Create a System, or be enslaved by another Man's
Wm. Blake 1757 - 1827

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cvsimport in cron
  2008-05-27 11:08     ` Michael J Gruber
  2008-05-27 11:31       ` Martin Langhoff
@ 2008-05-27 13:33       ` John J. Franey
  2008-05-27 15:31         ` Barra Mac Mathúna
  1 sibling, 1 reply; 8+ messages in thread
From: John J. Franey @ 2008-05-27 13:33 UTC (permalink / raw)
  To: Michael J Gruber, Barra Mac Mathúna; +Cc: git

On Tue, 2008-05-27 at 13:08 +0200, Michael J Gruber wrote:
> Barra Mac Mathúna venit, vidit, dixit 27.05.2008 12:45:
> > Thanks Martin,
> > 
> > Nice to know how to log the progress! Good tip to try normal cvs over
> > ssh, which works fine.
> > 
> > I wish it was possible to get more verbose output from the git
> > cvsimport command. The connection refused error seems to me to be
> > misleading. I would expect at least some output from cvsps but it
> > doesn't even get to the first step.
> > 
> > So if everything works at the command line, what significant things
> > can be different in a cron job?
> 
> The environment! Put "env" in your cron job and compare the output to 
> "env" on the command line. cvs or cvsps may be in $PATH on the command 
> line but not in cron, or $PERL5LIB might be different.
> 
> Cheers,
> Michael
> 

Great suggestion!

I am also having this problem.  To debug, I inserted env as you
suggested.  (Doh, why didn't this occur to me weeks ago?).  I compared
the output of cron and login-shell runs.

So what is the critical env diff between cron run and login run?

The answer is:  CVS_RSH=ssh

Be sure to export.

Thanks.
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cvsimport in cron
  2008-05-27 13:33       ` John J. Franey
@ 2008-05-27 15:31         ` Barra Mac Mathúna
  0 siblings, 0 replies; 8+ messages in thread
From: Barra Mac Mathúna @ 2008-05-27 15:31 UTC (permalink / raw)
  To: John J. Franey; +Cc: Michael J Gruber, git

Wow thanks so much!!

It's great to get such a quality response from the mailing list!

On to the next problem :-)


On Tue, May 27, 2008 at 1:33 PM, John J. Franey <jjfraney@gmail.com> wrote:
> On Tue, 2008-05-27 at 13:08 +0200, Michael J Gruber wrote:
>> Barra Mac Mathúna venit, vidit, dixit 27.05.2008 12:45:
>> > Thanks Martin,
>> >
>> > Nice to know how to log the progress! Good tip to try normal cvs over
>> > ssh, which works fine.
>> >
>> > I wish it was possible to get more verbose output from the git
>> > cvsimport command. The connection refused error seems to me to be
>> > misleading. I would expect at least some output from cvsps but it
>> > doesn't even get to the first step.
>> >
>> > So if everything works at the command line, what significant things
>> > can be different in a cron job?
>>
>> The environment! Put "env" in your cron job and compare the output to
>> "env" on the command line. cvs or cvsps may be in $PATH on the command
>> line but not in cron, or $PERL5LIB might be different.
>>
>> Cheers,
>> Michael
>>
>
> Great suggestion!
>
> I am also having this problem.  To debug, I inserted env as you
> suggested.  (Doh, why didn't this occur to me weeks ago?).  I compared
> the output of cron and login-shell runs.
>
> So what is the critical env diff between cron run and login run?
>
> The answer is:  CVS_RSH=ssh
>
> Be sure to export.
>
> Thanks.
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>



-- 
I must Create a System, or be enslaved by another Man's
Wm. Blake 1757 - 1827

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-05-27 15:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-26 18:00 cvsimport in cron barrymac
2008-05-26 23:13 ` Martin Langhoff
2008-05-27 10:45   ` Barra Mac Mathúna
2008-05-27 11:08     ` Michael J Gruber
2008-05-27 11:31       ` Martin Langhoff
2008-05-27 13:33       ` John J. Franey
2008-05-27 15:31         ` Barra Mac Mathúna
2008-05-27 12:08     ` Barra Mac Mathúna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).