delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/02/19/19:00:57

X-Spam-Check-By: sourceware.org
Message-ID: <c6bed70f0702191559x3514a6ffqb86579fac76945c3@mail.gmail.com>
Date: Mon, 19 Feb 2007 18:59:48 -0500
From: Daksa <spammb AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: cron run task can not see samba mounts.
In-Reply-To: <45D8EF14.5040509@cygwin.com>
MIME-Version: 1.0
References: <c6bed70f0702181607p2297f565vbde44eab65151072 AT mail DOT gmail DOT com> <45D8EF14 DOT 5040509 AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Thanks for the link, those pointers eventually lead to me solving this
nasty issue. The FAQ makes it sound simple to get private shares
working, but in reality it is not entirely straight forward. Providing
the password to net use while cron was being run as the SYSTEM user
did not fix the issue. The share was still listed as unavailable.
Likewise running cron as my own user did not fix the issue. Getting
cron to run as my user was not entirely straight forward because as it
turned out the /etc/passwd entry for my user was incorrect. I had to
first use mkpasswd to get a valid /etc/passwd entry and then use
cron-config to get cron to run as my user. Then, even after all of
this, the share was still returning Unavailable. It wasn't until I
additionally used net use on top of running cron as my user until I
cron finally was able to properly see the private share. Is there
somewhere where a more detailed how-to on this exists or perhaps a
wiki where I and other users could explain this task in more detail?
Here is the current iteration of my script with sensitive info
replaced:

#!/usr/bin/bash

( echo ""
date
net use z: \\\\192.168.1.101\\homes /u:user "*************"
net use
df
nice -19 rsync -au /cygdrive/c/Documents\ and\ Settings/Mike/
/cygdrive/z/backup/c/Documents\ and\ Settings/Mike/ &
nice -19 rsync -au /cygdrive/g/Photos/ /cygdrive/z/backup/g/Photos/ &
nice -19 rsync -au /cygdrive/g/Temp/ /cygdrive/z/backup/g/Temp/ &
nice -19 rsync -au /cygdrive/g/Desktop\ Extension/
/cygdrive/z/backup/g/Desktop\ Extension/ &
) >> /home/Mike/rsync.log 2>&1

On 2/18/07, Larry Hall (Cygwin) <reply-to-list-only-lh AT cygwin DOT com> wrote:
> Daksa wrote:
>
> <snip>
>
> > As you can see, when I run the command manually from a xcygwin xterm
> > the script has no issues seeing z: mounted at /mnt/z. No such luck
> > when the script is run from cron. I notice some subtle differences in
> > the env but I can't explain why the samba share would not appear from
> > the cron...
> >
>
> Read the FAQ entry:
>
> <http://cygwin.com/faq/faq-nochunks.html#faq.using.shares>
>
> --
> 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/
>
>

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019