cronjob + sed

View: New views
5 Messages — Rating Filter:   Alert me  

cronjob + sed

by linux1974 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

How do you set up cronjobs with cygwin? If I want to run a script that uses sed ( does thet standard sed that comes with cygwin supports /s /g etc commands to manipulate a string or do I need to upgrade sed? )
and gets an input file  from a windows directory and output a new file on that directory?
Tried to look for crontab  but couldn't find.
Thanks

Re: cronjob + sed

by Brian Dessent :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

linux1974 wrote:

> How do you set up cronjobs with cygwin? If I want to run a script that uses
> sed ( does thet standard sed that comes with cygwin supports /s /g etc
> commands to manipulate a string or do I need to upgrade sed? )
> and gets an input file  from a windows directory and output a new file on
> that directory?
> Tried to look for crontab  but couldn't find.

Editing the crontab is exactly as you would on linux, type "crontab -e"
and edit with whatever editor you've set EDITOR to.  When you save, it
will be installed.  Type "man 5 crontab" for details.  Remember to use
POSIX paths, not windows paths in your cron jobs.  You of course need to
install the cron package, I hope that goes without saying.  To install
the cron daemon itself (as a service) you need to run cron-config.

Cygwin includes GNU sed, same as on linux.  But then again I don't know
that a sed exists that doesn't support basic regular expression
functions.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Re: cronjob + sed

by linux1974 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi

I am not familiar with cygwin, where I can find the packages crontab and VI?
tks

Brian Dessent wrote:
linux1974 wrote:

> How do you set up cronjobs with cygwin? If I want to run a script that uses
> sed ( does thet standard sed that comes with cygwin supports /s /g etc
> commands to manipulate a string or do I need to upgrade sed? )
> and gets an input file  from a windows directory and output a new file on
> that directory?
> Tried to look for crontab  but couldn't find.

Editing the crontab is exactly as you would on linux, type "crontab -e"
and edit with whatever editor you've set EDITOR to.  When you save, it
will be installed.  Type "man 5 crontab" for details.  Remember to use
POSIX paths, not windows paths in your cron jobs.  You of course need to
install the cron package, I hope that goes without saying.  To install
the cron daemon itself (as a service) you need to run cron-config.

Cygwin includes GNU sed, same as on linux.  But then again I don't know
that a sed exists that doesn't support basic regular expression
functions.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Re: cronjob + sed

by Igor Peshansky :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ugh, top-posting...  Reformatted.
Also, please don't prepend "[ANNOUNCEMENT]" to subjects of random
messages.  This string is prepended automatically for messages forwarded
from the cygwin-announce mailing list, and is usually used for real
announcements.

More below.

On Mon, 26 Feb 2007, linux1974 wrote:

> Brian Dessent wrote:
> >
> > linux1974 wrote:
> >
> >> How do you set up cronjobs with cygwin? If I want to run a script
> >> that uses sed ( does thet standard sed that comes with cygwin
> >> supports /s /g etc commands to manipulate a string or do I need to
> >> upgrade sed? ) and gets an input file from a windows directory and
> >> output a new file on that directory? Tried to look for crontab but
> >> couldn't find.
> >
> > Editing the crontab is exactly as you would on linux, type "crontab
> > -e" and edit with whatever editor you've set EDITOR to.  When you
> > save, it will be installed.  Type "man 5 crontab" for details.
> > Remember to use POSIX paths, not windows paths in your cron jobs.
> > You of course need to install the cron package, I hope that goes
> > without saying.  To install the cron daemon itself (as a service) you
> > need to run cron-config.
> >
> > Cygwin includes GNU sed, same as on linux.  But then again I don't
> > know that a sed exists that doesn't support basic regular expression
> > functions.
>
> I am not familiar with cygwin, where I can find the packages crontab and
> VI?

<http://cygwin.com/faq/faq.setup.html#faq.setup.what-packages>.
HTH,
        Igor
--
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_    pechtcha@... | igor@...
ZZZzz /,`.-'`'    -.  ;-;;,_ Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-' old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Freedom is just another word for "nothing left to lose"...  -- Janis Joplin

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Re: cronjob + sed

by David le Comte :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

linux1974 wrote:

> Hi
>
> How do you set up cronjobs with cygwin? If I want to run a script that uses
> sed ( does thet standard sed that comes with cygwin supports /s /g etc
> commands to manipulate a string or do I need to upgrade sed? )
> and gets an input file  from a windows directory and output a new file on
> that directory?
> Tried to look for crontab  but couldn't find.
> Thanks
>  
I did this only a few weeks ago.

The cron stuff isn't normally included.  Re-run the Cygwin setup.exe.  
Go to the Admin section,
expand it, and make sure you get it to send you everything from that
section.  You
will then be asked to include a couple of dependencies to which you should
"OK".

After that everything is pretty well as you would expect from a vanilla
System V (did cron work
the same way in BSD?), except invoking the daemon.  The latter I haven't
quite worked out.  I, myself,
invoke it (the cron daemon itself runs as a Windows "service", and it
resides in /usr/slib/bin which wont be
in any usual PATH) from my .bash_profile (which is a bit silly).  If I
turn my machine off, as soon
as I invoke my first bash shell, the daemon starts - I suspect that I'm
supposed to add it to the list
of Windows Services, but the thought of having to work out how to do
that (in Windows), I find
a bit annoying - [ I hate dealing with my XP OS].

regards,

DleC

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/