BackupPC-users

Re: [BackupPC-users] UPDATED: Fully automated script for creating shadow copies and launching rsyncd

2009-03-27 16:00:56
Subject: Re: [BackupPC-users] UPDATED: Fully automated script for creating shadow copies and launching rsyncd
From: "Jeffrey J. Kosowsky" <backuppc AT kosowsky DOT org>
To: "David Lasker" <dave AT altosdesign DOT com>
Date: Fri, 27 Mar 2009 15:46:59 -0400
Agree with all of your revised comments -- and I will make the
tests/changes when I have a chance.

The only nit I would pick is with cyrunsrv and rsyncd. It is probably
inherently dangerous to have two different rsyncd processes running at
the same time unless you are careful to run them on different ports
(and probably also different log files) since by the nature of how
this script works it modifies the rsyncd.conf file and therefore must
use a special instance of rsyncd. Therefore, if you are using both my
script and a separate rsyncd process, I would recommend
starting/stopping rsyncd for each task (this is what my script does
and thus it leaves a clean when vss is not running). If you are
careful to use a separate port and keep track of pids then you could
have concurrent rsyncd processes but I would leave that for expert
users to do at their own risk. In either case, there is nothing wrong
with using cygrunsrv to set up the service - just make sure to
start/stop the rsyncd service itself appropriately.



David Lasker wrote at about 09:49:30 -0700 on Friday, March 27, 2009:
 > Hi Jeffrey
 > 
 > Thanks for the quick response.
 > 
 > Here are my comments on your comments:
 > 
 > 1. The UserScripts section of the BackupPC wiki is here:
 > http://backuppc.wiki.sourceforge.net/CustomUserScripts I believe that anyone
 > with a sourceforge account can edit it. If you have trouble doing so, please
 > email me the script privately, and I'll give it a try.
 > 
 > 2. I agree that you should *not* hard code the 'root' alternative. I am
 > hoping that someone on this list understands cygwin better than we do, and
 > can advise us as to what is really going on, and what is the best fix. For
 > now, let's just address this issue in the documentation.
 > 
 > 4. This issue refers only to the comments at the beginning of the script for
 > its suggested usage, lines 22-27. The executable code in the script is fine.
 > I believe that $hostIP will always work in all cases. $host will only work
 > if PC host names are resolvable via DNS. $host fails for me since my PC's
 > are not in DNS. If you have a chance, can you give $hostIP a try in your
 > site and verify it works for you?
 > 
 > 5 and 6. You are correct, and sorry for the confusion. But I think there
 > might still be an issue: if your script kills the Windows rsyncd service,
 > and a user tries to do a restore after a backup, then I believe that restore
 > will fail, since there will not be a rsyncd running on the PC.
 > 
 > In my site, I was happy to completely remove the rsyncd Windows service,
 > resulting in one less thing to do when a PC starts up. That is why I needed
 > to add the $Conf{RestorePreUserCmd} and $Conf{RestorePostUserCmd} to my
 > BackupPC config.
 > 
 > You are correct that you can't use VSS for restore. I used the '-u 0'
 > parameter on restores, to force the script to start an rsyncd daemon in
 > non-shadow mode.
 > 
 > So for now, the only changes I would suggest for the script are fixing the
 > "nuul" typo, and some additional comments.
 > 
 > Thanks for the help!
 > 
 > Dave
 > 
 > -----Original Message-----
 > From: Jeffrey J. Kosowsky [mailto:backuppc AT kosowsky DOT org] 
 > Sent: Thursday, March 26, 2009 10:39 PM
 > To: General list for user discussion, questions and support
 > Subject: Re: [BackupPC-users] UPDATED: Fully automated script for creating
 > shadow copies and launching rsyncd
 > 
 > David Lasker wrote at about 15:21:11 -0700 on Thursday, March 26, 2009:
 >  > I was trying to figure out the best way to deploy VSS with BackupPC on my
 >  > Windows XP PCs, and found this wonderful script. Thank you so much
 > Jeffrey
 >  > for sharing it!
 >  > 
 >  > I ran into (and solved) a few issues when deploying version 0.3 of the
 >  > script that I wanted to share, in the hope of making it easier for the
 > next
 >  > user.
 >  > 
 > Thanks for the compliments and for the feedback
 > 
 >  > 1. The various archives for this mailing list all mangle the script in
 >  > different ways, i.e. at signs and colons get changed, extra newlines
 > added,
 >  > indents removed, etc. It took me several hours of studying diffs between
 > the
 >  > versions on backupcentral.com and mailarchive.com to get a working
 > version.
 >  > Could Jeffery post this script in the "User Scripts" section of the wiki?
 > 
 > I would be happy to do that if you tell me where it is and what I need
 > to do.
 > 
 >  > 
 >  > 2. The script requires it be in the group "Administrators". I find it
 >  > impossible to set this group on my Windows PCs. When I chgrp a file to
 >  > "Administrators" or group number 544, the group name is changed to "root"
 >  > which is group number 0. I think this might be because both
 > Administrators
 >  > and root both have the same SID in /etc/group. I finally gave up and
 > changed
 >  > the script to allow ownership by either "Administrators" or "root" like
 >  > this:
 >  > 
 >  >  #Check permissions on files we call. Also touch SHADOWLOCK
 >  >  # Set up SHADOWDIR and check their permissions
 >  >  if [ $USESHADOWS -gt 0 ] && touch $SHADOWLOCK && \
 >  >   ! ( stat -c %A $0 | grep -q "^....r.x" && \
 >  >   [[ $(stat -c %G $0 ) =~ Administrators|root ]] && \
 >  >   stat -c %A $SHADOWEXECCMD | grep -q "^....r.x" && \
 >  >   [[ $(stat -c %G $SHADOWEXECCMD) =~ Administrators|root ]]  && \
 >  > 
 >  > If anyone has a better solution to this problem, please let me know.
 > 
 > I am by no means a Windows expert - but perhaps different versions use
 > different names for the superuser equivalent. Before I hard code in the
 > 'root' alternative, it would be helpful to know whether these are the
 > only two possibilities or whether other versions or setups of Windows
 > use additional terms for the superuser
 > 
 >  > 
 >  > 3. There is a typo in the line:
 >  > 
 >  >  $DOSDEV "${letter}:" /D 2> /dev/nuul
 >  > 
 >  > which should be changed to /dev/null
 > Good catch - I will make this change
 >  > 
 >  > 4. If using nmblookup to resolve PC host names, then the calls to the
 > script
 >  > in the pc config files should use $hostIP instead of $host.
 > Can you elaborate here so I know how to change the script?
 > Would $hostIP work in both cases or is some type of 'test' or config
 > necessary to determine which one to use?
 > 
 >  > 
 >  > 5. If you were previously running rsyncd as a Windows service, you need
 > to
 >  > remove it, by using cygrunsrv -R.
 > I do not believe this is necessary. I have the service set up. A
 > problem would potentially only exist if you had the service started
 > automatically and left it running (in that case, the script would
 > either complain about rsyncd already running or kill it depending on
 > how you have the configuration set up)
 > 
 >  > 6. The script needs to be called in $Conf{RestorePreUserCmd} and
 >  > $Conf{RestorePostUserCmd} with the additional parameter "-u 0" in order
 > for
 >  > restores to work.
 > To tell you the truth, I never tested the script on a restore.
 > Actually, I'm not sure you want to use VSS on a restore since wouldn't
 > you want to restore to the *current* filesystem rather than to a
 > shadow copy. In fact, I thought shadow copies were read only anyway.
 > Maybe I'm missing something so please help me here...
 > 
 >  > 
 >  > Hope that helps...
 > Very helpful! Let's continue the dialog and once we get the above
 > points nailed down, I will release an updated version incorporating
 > these changes.
 > 

------------------------------------------------------------------------------
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

<Prev in Thread] Current Thread [Next in Thread>