threads / discuss / 13674

cvsimport in cron

Subject: cvsimport in cron

## tl;dr

8 messages between May 26, 2008 and May 27, 2008.

replies: 7people: 4as markdown or json

barrymac· May 26, 2008, 18:00 UTC · lore
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.
Martin Langhoff· May 26, 2008, 23:13 UTC · re: barrymac · lore

Re: cvsimport in cron

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
Barra Mac Mathúna· May 27, 2008, 10:45 UTC · re: Martin Langhoff · lore

Re: cvsimport in cron

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:

Show 34 quoted lines
> 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
Michael J Gruber· May 27, 2008, 11:08 UTC · re: Barra Mac Mathúna · lore

Re: cvsimport in cron

Barra Mac Mathúna venit, vidit, dixit 27.05.2008 12:45:
Show 12 quoted lines
> 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

Martin Langhoff· May 27, 2008, 11:31 UTC · re: Michael J Gruber · lore

Re: cvsimport in cron

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
John J. Franey· May 27, 2008, 13:33 UTC · re: Michael J Gruber · lore

Re: cvsimport in cron

On Tue, 2008-05-27 at 13:08 +0200, Michael J Gruber wrote:
Show 21 quoted lines
> 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
Barra Mac Mathúna· May 27, 2008, 15:31 UTC · re: John J. Franey · lore

Re: cvsimport in cron

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:
Show 42 quoted lines
> 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
Barra Mac Mathúna· May 27, 2008, 12:08 UTC · re: Barra Mac Mathúna · lore

Re: cvsimport in cron

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:
Show 67 quoted lines
> 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

← back to recent threads