This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How can I run a script?


Actually my intent is to run this from an automated schedular.  As
Eric described it could be run from cron like any other Unix shell
script but I really don't want to add a cron daemon.  Was thinking
windoze schedular.

The base install of cygwin is on an E: drive.  C: didn't have enough room.

So if I understand correctly something like -


E:

chdir E:\cygwin\bin

bash --login -i -c 'rsync -avz root@10.0.0.2 :/home/funnel/Jan*
/cygdrive/e/Earchives'

So as I read more through the bash man the -c argument was what I was
looking for.

Then another question arises where does the std output and std error
go too?   2>&1 >> foo_file ?

I could fix that by running rsync in quite mode -q

Thanks

btb

On 1/14/08, Mirco Piccin <pictux@gmail.com> wrote:
> Hi.
>
> > can login to a shell from windows and run commands but how do I create a
> script
>
> I think you mean to run a command without open cygwin shell.
> If i understand well, here you are how i've done that.
>
> First of all, i've created a file .bat (example: run_rsynch.bat) on my
> desktop
> .. and inside that (supposing you install cygwin in your C: drive):
>
> C:
>
> chdir C:\cygwin\bin
>
>
>
> bash --login -i -c 'rsync -avz root@10.0.0.2:/home/funnel/Jan*
> /cygdrive/e/Earchives'
>
> Save & Exit.
> Now you need only to double-click in your .bat file and insert your
> password if required.
>
> Instead, if you want to create a  script to run in cygwin environment,
> follow the Eric post.
>
> ...my 2 cents...
>
> Regards
> M
>
> --
> 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/
>
>

--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]