X-Spam-Check-By: sourceware.org
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain; 	charset="us-ascii"
Subject: RE: how to detect if Windows or Linux is running?
Date: Thu, 1 Dec 2005 17:34:09 -0500
Message-ID: <31DDB7BE4BF41D4888D41709C476B6570246A86E@NIHCESMLBX5.nih.gov>
From: "Buchbinder, Barry \(NIH/NIAID\)" <BBuchbinder@niaid.nih.gov>
To: "H. S." <hs.samix@gmail.com>, <cygwin@cygwin.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id jB1MYNYH032275

H. S. wrote:
> Christopher Faylor wrote:
>> On Thu, Dec 01, 2005 at 05:07:15PM -0500, H. S. wrote:
>> 
>>> Hi,
>>> 
>>> I have installed Cygwin on a Windows XP computer to get rsync and
>>> ssh running so that I can backup my important data on a Linux
>>> computer on my home LAN. The idea is to use rsync to make rolling
>>> backups of my Windows data automatically, say, once or twice a day
>>> and to retain last N backups (N most probably going to be 10~20).
>>> 
>>> But the problem I had not foreseen is that I dual boot this Windows
>>> machine between Windows XP and Debian. How should I gracefully let
>>> the rsync server know if this computer is running Linux or XP?
>>> 
>>> I know that if the computer is running Linux, the rsync server will
>>> never find /cygdrive/... folders and will just quite with an error.
>>> But this is not 'clean', it will result in mails to the rsync
>>> server root about the error. 
>>> 
>>> Suggestions?
>> 
>> 
>> Why not just use mount to mount things similarly on the cygwin side
>> and the linux side? 
>> 
>> cgf
>> 
> 
> Even if I do that on the machine to be backed up, I still need to
> know what OS is running. This is for the situation in which I want to
> maintain different backups of Linux and of Windows data. To do this,
> rsync must now what it is backing up so that it does not overwrite
> previous backups of one OS with the new ones of the other.    
> 
> Or I misunderstood your post.
> 
> ->HS

Perhaps you could look for environmental variables that Windows sets but
Linux doesn't.  COMSPEC, windir, SystemDrive, SystemRoot, ProgramFiles,
CommonProgramFiles

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


