Help!

cron help with cygwin


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions (archive 1) RSS
Next:  Profiling support in linux kernel  
Author Message
erniedude
External


Since: Sep 12, 2005
Posts: 4



PostPosted: Fri May 05, 2006 7:27 am    Post subject: cron help with cygwin
Archived from groups: comp>os>linux>misc (more info?)

I'm having difficulty getting my cronjob to work...
I have a crontab called crontab.txt
It looks like this:

22 9 * * * cd /home/USER
23 9 * * * ./launch_HelloWorld_vbs.bat

In other words, every day, I want to run "launch_HelloWorld_vbs.bat" at
9:23am, which lives in the directory /home/USER.

Right now, I execute this cron job as follows:

crontab crontab.txt

I verified that there is a crontab file in /var/cron/tabs.

For some reason, I don't see the file running. Any ideas ?
Back to top
John-Paul Stewart
External


Since: Mar 29, 2005
Posts: 1520



PostPosted: Fri May 05, 2006 10:38 am    Post subject: Re: cron help with cygwin [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

erniedude DeleteThis @gmail.com wrote:
> I'm having difficulty getting my cronjob to work...
> I have a crontab called crontab.txt
> It looks like this:
>
> 22 9 * * * cd /home/USER
> 23 9 * * * ./launch_HelloWorld_vbs.bat
>
> In other words, every day, I want to run "launch_HelloWorld_vbs.bat" at
> 9:23am, which lives in the directory /home/USER.

This question has nothing to do with Linux. But:

That crontab file will *not* work. It'll run one cronjob that does the
'cd' command and a second, unrelated cronjob to run the file. You'd
want a *single* entry in your crontab:

22 9 * * * cd /home/USER && ./launch_HelloWorld_vbs.bat

At least that would work under Linux. I don't know what shell is used
for running cronjobs under Cygwin. If it's Bash, the same syntax applies.

For a definitive answer ask in a Cygwin newsgroup or mailing list, where
the question will be on-topic and where you'll find Cygwin experts.
Back to top
erniedude
External


Since: Sep 12, 2005
Posts: 4



PostPosted: Fri May 05, 2006 10:59 am    Post subject: Re: cron help with cygwin [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Lew Pitcher wrote:
> Is the cron daemon started? Does it continue to run after you log off?


I'm not sure. Maybe that's my problem.
Back to top
erniedude
External


Since: Sep 12, 2005
Posts: 4



PostPosted: Fri May 05, 2006 11:05 am    Post subject: Re: cron help with cygwin [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

stan RemoveThis @worldbadminton.com wrote:
> try a one-liner like cd /home/user;./launch_HelloWorld_vbs.bat
yeah, that would be better...


> Also I'd expect that your "bat" file is likely a Windows
> shell script in which case I wouldn't expect it to run inside
> a cygwin shell. try launching it in a Windows shell
> ( check help cmd for details )

Well, when I go to it's directory and type:
../launch_HelloWorld_vbs.bat, it runs fine.


> PS- please note that this is a LINUX group so you really
> should be taking CYGWIN issues elsewhere.

Oh, didn't realize there was a special CYGWIN group.

> PPS- if you are really trying to schedule a Windows job you should
> probably be using the Windows job scheduler ( "at" ).

Yeah, but I heard it through the grapevine cron was better.
Back to top
stan
External


Since: Aug 26, 2005
Posts: 240



PostPosted: Fri May 05, 2006 2:55 pm    Post subject: Re: cron help with cygwin [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

erniedude.RemoveThis@gmail.com wrote:
: I'm having difficulty getting my cronjob to work...
: I have a crontab called crontab.txt
: It looks like this:

: 22 9 * * * cd /home/USER
: 23 9 * * * ./launch_HelloWorld_vbs.bat

: In other words, every day, I want to run "launch_HelloWorld_vbs.bat" at
: 9:23am, which lives in the directory /home/USER.

Umm- I'd expect every job launched by cron to have its own
environment-- which would say that your bat file
is never being executed.

try a one-liner like cd /home/user;./launch_HelloWorld_vbs.bat

Also I'd expect that your "bat" file is likely a Windows
shell script in which case I wouldn't expect it to run inside
a cygwin shell. try launching it in a Windows shell
( check help cmd for details )

Stan

PS- please note that this is a LINUX group so you really
should be taking CYGWIN issues elsewhere.

PPS- if you are really trying to schedule a Windows job you should
probably be using the Windows job scheduler ( "at" ).

--
Stan Bischof ("stan" at the below domain)
www.worldbadminton.com
Back to top
Michael Heiming
External


Since: Apr 04, 2004
Posts: 3526



PostPosted: Fri May 05, 2006 8:38 pm    Post subject: Re: cron help with cygwin [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In comp.os.linux.misc erniedude RemoveThis @gmail.com:
> stan RemoveThis @worldbadminton.com wrote:

[ problems with cron on cygwin ]

> Oh, didn't realize there was a special CYGWIN group.

Not that I'm aware of, though there's iirc some mailing list for
the project. Just check the docs.

Still unsure why your post did show up here? Cron is the standard
scheduler on most unix systems and there are zillion of "unix"
ngs, but you posted to colm (comp.os.linux.misc)?

>> PPS- if you are really trying to schedule a Windows job you should
>> probably be using the Windows job scheduler ( "at" ).

> Yeah, but I heard it through the grapevine cron was better.

Indeed, it seems to me that unix is general a far superior OS. Wink

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo zvpunry RemoveThis @urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 236: Fanout dropping voltage too much, try cutting
some of those little traces
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions (archive 1) All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum