public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* some kind of path problem when running bash script from windows shortcut
@ 2012-03-22 17:22 LMH
  2012-03-22 17:37 ` Adam Dinwoodie
  0 siblings, 1 reply; 7+ messages in thread
From: LMH @ 2012-03-22 17:22 UTC (permalink / raw)
  To: cygwin

I have recently re-installed windows and cygwin, but my old backup 
script won't anymore when I run it from a windows icon. It runs fine if 
I cd to /usr/local/bin and run it from the command line.

When I run it from the shortcut, I get "file not found" for rsync, date, 
unix2dos, and rm. I have temporarily changed the script to use the full 
path for these, /cygdrive/c/cygwin/bin/date.exe instead of date, but I 
have used this setup for a while and I'm not sure what has changed. Am I 
missing an environment variable or something?

I'm not sure if the problem is in windows or cygwin.

This is the version of the script that doesn't work from the shortcut, 
but does work from the command line.

#!/bin/bash

# generic backup function
function backup {
   echo " " >> $1
   echo " " >> $1
   echo "***** new log entry *****" >> $1
   date >> $logfile_path
   rsync -v -a -r -p -b --suffix=.back -E -t --log-file=$1  $2  $3
   unix2dos $1
}

logfile_path="path_to_logfile"
backup_src_path="path_to_backup_src_loc"
backup_destination_path="path_to_dest_loc"
backup $logfile_path  $backup_src_path  $backup_destination_path

The shortcut is set up as,
Target: C:\cygwin\bin\sh.exe /usr/local/bin/backup.sh
Start in: C:\cygwin\bin

Any suggestions?

LMH

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

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

end of thread, other threads:[~2012-03-23 15:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-22 17:22 some kind of path problem when running bash script from windows shortcut LMH
2012-03-22 17:37 ` Adam Dinwoodie
2012-03-22 17:50   ` LMH
2012-03-22 18:40     ` Adam Dinwoodie
2012-03-22 18:47       ` LMH
2012-03-23 14:05     ` Andrey Repin
2012-03-23 15:50       ` LMH

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).