BackupPC-users

Re: [BackupPC-users] BackupPC Windows Client

2012-05-18 01:51:52
Subject: Re: [BackupPC-users] BackupPC Windows Client
From: Adam Goryachev <mailinglists AT websitemanagers.com DOT au>
To: backuppc-users AT lists.sourceforge DOT net
Date: Fri, 18 May 2012 15:49:21 +1000
On 12/05/12 07:42, Michael Stowe wrote:
> Based on some of the work here http://www.goodjobsucking.com/?p=62 and
> elsewhere, I finally put together a package that allows more-or-less
> instant installation of a scripted client for Windows machines for
> BackupPC that handles:
>
> - Open files (VSS)
> - Wake on LAN
>
> For the past 3 years or so, this has gone through a number of tweaks, but
> now I'm comfortable that it's a one-click, seamless installation, once the
> server side is set up.  It includes all the necessary binaries
>
> I'm making it available here:
>
> http://www.michaelstowe.com/backuppc/
>
> (If there are banner ads, feel free to ignore them, they help pay for
> bandwidth.)
>
> Questions/comments welcome, of course.
>
Firstly, I'd like to say "THANK YOU!", you have done truly an amazing
amount of work to get this far, and thank you very much, it will make my
life much easier I'm sure.

Secondly, a couple of things I needed to adjust in the scripts:

1) Rather than adding the windows administrator username and password
into the preuser and postuser scripts, I created a single auth.sh file,
and sourced that from each of the other two scripts. Obviously paying
particular attention to the permissions on this one file.
2) Since I have a space in my Administrator password I needed to add
some quotes to the command lines for winexe

--- tmp/preusercmd.sh    2012-05-12 06:53:21.000000000 +1000
+++ preusercmd.sh    2012-05-18 14:42:34.000000000 +1000
@@ -1,9 +1,7 @@
 #!/bin/bash
+. /etc/backuppc/scripts/auth.sh
 WINEXE=/usr/bin/winexe
-UNAME="Administrator"
-PWD="password"
-WRKGRP="WORKGROUP"
 BOX=$1
-$WINEXE --interactive=0 -U $UNAME -W $WRKGRP --password=$PWD //$BOX
'cmd /c c:\backuppc\pre-exec.cmd' <&-
+$WINEXE --interactive=0 -U $UNAME -W $WRKGRP "--password=${PWD}" //$BOX
'cmd /c c:\backuppc\pre-exec.cmd' <&-
 sleep 5
 echo "Rsync and shadow copy loaded"

--- tmp/postusercmd.sh    2012-05-12 07:13:56.000000000 +1000
+++ postusercmd.sh    2012-05-18 14:41:44.000000000 +1000
@@ -1,11 +1,9 @@
 #!/bin/bash
+. /etc/backuppc/scripts/auth.sh
 WINEXE=/usr/bin/winexe
-UNAME="Administrator"
-PWD="password"
-WRKGRP="WORKGROUP"
 WOLDIR=/usr/tools/wol
 BOX=$1
-$WINEXE -U $UNAME -W $WRKGRP --password=$PWD //$BOX 'cmd /c echo '1' >
c:\backuppc\wake.up' <&-
+$WINEXE -U $UNAME -W $WRKGRP "--password=${PWD}" //$BOX 'cmd /c echo
'1' > c:\backuppc\wake.up' <&-
 echo "Rsync and shadow copy unloaded"
 if [ $xferOK -eq 1 ]; then
    if [ -f $WOLDIR/$BOX.state ]; then
@@ -13,7 +11,7 @@
       echo -n "State before backup: "
       echo $wasoff
       if [ "$wasoff" = "OFF" ]; then
-         $WINEXE -U $UNAME --password=$PWD //$BOX 'shutdown -f -s -c
"Backup Completed"' <&-
+         $WINEXE -U $UNAME "--password=${PWD}" //$BOX 'shutdown -f -s
-c "Backup Completed"' <&-
          echo "System shut down"
       fi
    rm $WOLDIR/$BOX.state

Content of auth.sh (chmod 700 or 500)
#!/bin/bash
UNAME="Administrator"
PWD="some pass"
WRKGRP="WORKGROUP"

Finally, one thing that took me by surprise, I was asked by the windows
install utility for the rsync username and password, but the username
wasn't added to the rsyncd.conf file (so I added it manually) and the
username and password was not added to the rsyncd.secrets file (in fact,
the secrets file did not exist at all).

Not terribly important, but perhaps this could be added to the Client
Installer instructions, or else added to the program to be done during
installation.

PS, this was on a windows XP Pro machine (if it makes a difference)....

Thank you again for a great utility and solution.

Regards,
Adam

-- 
Adam Goryachev
Website Managers
www.websitemanagers.com.au


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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/