LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices

Reply
 
Search this Thread
Old 05-31-2005, 03:09 AM   #1
hq4ever
Member
 
Registered: May 2004
Location: Israel
Distribution: Debian
Posts: 98

Rep: Reputation: 15
Executing cron jobs on a w2k3 server using cygwin


Hello,

I need to run cygwin (or more correctly bash) on a windows server, this for parsing the Apache logs using a bash script.

All is fine, I've downloaded cygwin & installed it on the server, the only trouble is that I can't set cygwin to run as a service on the windows server.

Somebody maybe aware of an option of setting cygwin (or just bash + cron jobs) without logging in as a user (i.e. "service") on windows.

Thank you,
Maxim.
 
Old 05-31-2005, 01:30 PM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 57
Moved: This thread is more suitable in the General forum and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 06-01-2005, 05:35 AM   #3
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,192

Rep: Reputation: 101Reputation: 101
put this into a batch file
Code:
@echo off

C:
chdir C:\cygwin\bin

bash --login -i path/to/scriptfile
and then run it in scheduled tasks. I think it should work, havent tested it.


EDIT: just done a little test, seems to work. the path to the scriptfile, logfiles must be what you would use whilst in cygwin and not windows paths

Last edited by phil.d.g; 06-01-2005 at 05:39 AM.
 
Old 06-01-2005, 07:27 AM   #4
hq4ever
Member
 
Registered: May 2004
Location: Israel
Distribution: Debian
Posts: 98

Original Poster
Rep: Reputation: 15
This is nice, thank you.

One other solution someone offered me on a different forum, was the obvious cron job.
The trick is to set cron to run as a service on windows, this is done using cygrunsrv the problem now is this : I just can't find the documentation of it to see what option I can set, and I wouldn't want to make services (or the server) without fully understanding what and how then run.

b.t.w Could you please in 2 words explain why :
use interactive shell ?
and
why does it needs to be a login shell ?


Anyhow, thank you for the idea of using windows scheduler.
Maxim.
 
Old 06-01-2005, 07:45 AM   #5
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,192

Rep: Reputation: 101Reputation: 101
probably doesn't need to be interactive, alls I did was look at the cygwin.bat file, look at 'man bash' to find out how to run a script file directly then put the two together, didn't pay any attention to the arguements already there.

Aslo I never knew about the cygrunsrv app. If I had read all the documentation I probably would be able to come up with a more elegant solution.

I only use cygwin on my laptop and when I can't ssh into my server or my university deparmental computers, which really isn't that often.

Try without the options, see what happens
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache/PHP: Executing 'at' scheduled jobs? bomix Linux - Software 11 01-23-2009 02:02 PM
Cron Jobs XaViaR Linux - General 1 06-23-2005 07:57 PM
cron jobs working2hard Linux - Software 0 07-28-2004 06:31 PM
CRON Jobs scottpioso Linux - Software 63 11-28-2003 07:45 PM
cron jobs Zyanid Linux - Software 0 08-27-2002 06:10 AM


All times are GMT -5. The time now is 03:27 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration