public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Question about windows shortchts to start a bash script
@ 2009-01-19  3:39 LMHmedchem
  2009-01-19  8:07 ` Larry Hall (Cygwin)
  0 siblings, 1 reply; 4+ messages in thread
From: LMHmedchem @ 2009-01-19  3:39 UTC (permalink / raw)
  To: cygwin


Greetings to the Cygwin list forum,

I have had some difficulty finding a place to post this question and I hope
this is it. 

I have a cygwin bash script that runs rsync and makes some entries in the
rsync log files.

Here is an example.
     echo " " >> F:/_Data_Volume_Backup/rsync_log/01_Data_Level_log.txt
     echo " " >> F:/_Data_Volume_Backup/rsync_log/01_Data_Level_log.txt
     echo "***** new log entry *****" >>
F:/_Data_Volume_Backup/rsync_log/01_Data_Level_log.txt
     date >> F:/_Data_Volume_Backup/rsync_log/01_Data_Level_log.txt
     rsync -v -a -r -p -b --suffix=.back -E -t
--log-file=/cygdrive/f/_Data_Volume_Backup/rsync_log/01_Data_Level_log.txt 
/cygdrive/d/_Data_Level/  /cygdrive/f/_Data_Volume_Backup/_Data_Level/
     unix2dos F:/_Data_Volume_Backup/rsync_log/01_Data_Level_log.txt 

This script just puts a couple of newline characters between log entries and
then sticks in the date. Then rsync is called and last unix2dos is called to
make the logfile readable in notepad. 

I call this script from a desktop shortcut with the following properties.
Target: C:\cygwin\bin\sh.exe /usr/local/bin/DLBackup.sh
Start in: C:\cygwin\bin

I have run this script for a long time on another computer, but when I just
set it up on a different computer, the bash terminal opens briefly, displays
some messages that are almost too fast to read, and then closes. The log
files have entries for  "***** new log entry *****", so the script is
getting that far, but the error message "date: command not found" and
"rsync: command not found" are written to the shell. If I run the script
from the shell, it runs normally and I get the anticipated results.

Can anyone tell me why this is not working, especially since it works on
another computer with the same setup?

Thanks

LMHmedchem
-- 
View this message in context: http://www.nabble.com/Question-about-windows-shortchts-to-start-a-bash-script-tp21536086p21536086.html
Sent from the Cygwin list mailing list archive at Nabble.com.


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question about windows shortchts to start a bash script
  2009-01-19  3:39 Question about windows shortchts to start a bash script LMHmedchem
@ 2009-01-19  8:07 ` Larry Hall (Cygwin)
  2009-01-19  8:20   ` LMHmedchem
  0 siblings, 1 reply; 4+ messages in thread
From: Larry Hall (Cygwin) @ 2009-01-19  8:07 UTC (permalink / raw)
  To: cygwin

On 01/18/2009, LMHmedchem wrote:
> Can anyone tell me why this is not working, especially since it works on
> another computer with the same setup?

Without any configuration information from the machine having this problem,
it's hard to say anything too definitive.  However, my WAG is that you don't
have Cygwin in your Windows path on this new machine but do on the other.

If you need to follow-up with this list on this issue, I recommend reading
<http://cygwin.com/problems.html> to find out the necessary information
required for a problem report.

-- 
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
216 Dalton Rd.                          (508) 893-9889 - FAX
Holliston, MA 01746

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question about windows shortchts to start a bash script
  2009-01-19  8:07 ` Larry Hall (Cygwin)
@ 2009-01-19  8:20   ` LMHmedchem
  2009-01-19  9:25     ` Larry Hall (Cygwin)
  0 siblings, 1 reply; 4+ messages in thread
From: LMHmedchem @ 2009-01-19  8:20 UTC (permalink / raw)
  To: cygwin


I added "c:\cygwin\bin;" to the path and that seems to have corrected the
problem, thanks for the tip.

Two questions if you have a minute,

1. At first I tried adding cygwin to the end of the path, but that didn't
work. I checked my other machine and found cygwin immediately after
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;
I stuck cygwin in as the first entry after Wbem, and it worked after that. I
am surprised that it matters where it is in the list. Does it actually
matter or do you think I made an error in my first entry?

2. There was another variable on my other machine,
Variable name:
CYGWIN
Variable value:
ntsec tty

I did not set up that environment and I am wondering if that really needs to
be there.

Thanks again for your help.

LMHmedchem

-- 
View this message in context: http://www.nabble.com/Question-about-windows-shortcuts-to-start-a-bash-script-tp21536086p21536420.html
Sent from the Cygwin list mailing list archive at Nabble.com.


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question about windows shortchts to start a bash script
  2009-01-19  8:20   ` LMHmedchem
@ 2009-01-19  9:25     ` Larry Hall (Cygwin)
  0 siblings, 0 replies; 4+ messages in thread
From: Larry Hall (Cygwin) @ 2009-01-19  9:25 UTC (permalink / raw)
  To: cygwin

LMHmedchem wrote:
> I added "c:\cygwin\bin;" to the path and that seems to have corrected the
> problem, thanks for the tip.
> 
> Two questions if you have a minute,
> 
> 1. At first I tried adding cygwin to the end of the path, but that didn't
> work. I checked my other machine and found cygwin immediately after
> %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;
> I stuck cygwin in as the first entry after Wbem, and it worked after that. I
> am surprised that it matters where it is in the list. Does it actually
> matter or do you think I made an error in my first entry?

The order doesn't matter.

> 2. There was another variable on my other machine,
> Variable name:
> CYGWIN
> Variable value:
> ntsec tty
> 
> I did not set up that environment and I am wondering if that really needs to
> be there.

No, it's not a requirement.  'ntsec' is default now, so that setting is
redundant.  'tty' is only needed if you require pty emulation in a
Cygwin shell started from a Windows cmd.exe window.  See:

<http://cygwin.com/cygwin-ug-net/using-cygwinenv.html>


-- 
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
216 Dalton Rd.                          (508) 893-9889 - FAX
Holliston, MA 01746

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-19  3:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-19  3:39 Question about windows shortchts to start a bash script LMHmedchem
2009-01-19  8:07 ` Larry Hall (Cygwin)
2009-01-19  8:20   ` LMHmedchem
2009-01-19  9:25     ` Larry Hall (Cygwin)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).