Re: [BackupPC-users] config.pl "built-in" script to backup Windows shares with Virtual Shadow Service Copy

2021-01-03 Thread backuppc
Dan Johansson wrote at about 17:25:56 +0100 on Sunday, January 3, 2021:
 > Tanks for your Feedback!
 > 
 > On 03.01.21 16:19, backu...@kosowsky.org wrote:
 > > Dan Johansson wrote at about 14:24:25 +0100 on Sunday, January 3, 2021:
 > >   > On 30.06.20 06:51, backu...@kosowsky.org wrote:
 > >   > > Over the years, many have asked and struggled with backing up remote
 > >   > > Windows shares with shadow copies. Shadow copies are useful since 
 > > they
 > >   > > allow both the backup to be 'consistent' and allow for reading files
 > >   > > that are otherwise 'busy' and unreadable when part of active Windows
 > >   > > partitions.
 > >   > >
 > > 
 > >   > I found this old email with the attached script.
 > >   > I have tried to set it up, but sadly I can not get it to work. (:-(
 > > 
 > > Some details would be helpful...
 > > 
 > >>
 > >   > So now I have two questions.
 > >   >
 > >   > a) What is the syntax of the "Conf{ClientShareName2Path}" hash? 
 > > Examples?
 > > 
 > > $Conf{ClientShareName2Path} = {
 > >  'backuppc' => '/var/lib/backuppc',
 > >  'boot-efi' => '/boot/efi',
 > >  'home' => '/home',
 > >  'root' => '/',
 > > };
 > > 
 > 
 > That looks like "Linux" paths and not "Windows" (i.e. C:\) paths.
 > How would "Windows" paths be defined?
 > 
 > $Conf{ClientShareName2Path} = {
 >   'C' => 'C:\\',
 > };
 > 
 > -- or maybe --
 > 
 > $Conf{ClientShareName2Path} = {
 >   'C' => '/tmp/shadows/C',
 > };
 > ?
 > 

Ooops sorry you are right... that is for my btrfs snapshot script
which I use on Linux - that does the analogous thing of VSS on
Windoze.

$Conf{ClientShareName2Path} = {
'c' => '/c',
'd' => '/d',
'e' => '/e',
#'g' => '/g/',
};



___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/


Re: [BackupPC-users] config.pl "built-in" script to backup Windows shares with Virtual Shadow Service Copy

2021-01-03 Thread Dan Johansson

Tanks for your Feedback!

On 03.01.21 16:19, backu...@kosowsky.org wrote:

Dan Johansson wrote at about 14:24:25 +0100 on Sunday, January 3, 2021:
  > On 30.06.20 06:51, backu...@kosowsky.org wrote:
  > > Over the years, many have asked and struggled with backing up remote
  > > Windows shares with shadow copies. Shadow copies are useful since they
  > > allow both the backup to be 'consistent' and allow for reading files
  > > that are otherwise 'busy' and unreadable when part of active Windows
  > > partitions.
  > >

  > I found this old email with the attached script.
  > I have tried to set it up, but sadly I can not get it to work. (:-(

Some details would be helpful...




  > So now I have two questions.
  >
  > a) What is the syntax of the "Conf{ClientShareName2Path}" hash? Examples?

$Conf{ClientShareName2Path} = {
 'backuppc' => '/var/lib/backuppc',
 'boot-efi' => '/boot/efi',
 'home' => '/home',
 'root' => '/',
};



That looks like "Linux" paths and not "Windows" (i.e. C:\) paths.
How would "Windows" paths be defined?

$Conf{ClientShareName2Path} = {
 'C' => 'C:\\',
};

-- or maybe --

$Conf{ClientShareName2Path} = {
 'C' => '/tmp/shadows/C',
};
?


b) How shall the rsyncd be configured (rsyncd.conf, rsyncd.secrets)?


The script uses 'rsync' not 'rsyncd'
Not sure why you would ever want to use 'rsyncd' as it is less secure
(it uses a password 'secret' rather than a passphrase) and is more
complicated to setup than just running ssh over a background sshd daemon.


OK, that makes sense and I will change it to ssh+rsync.

Regards,
--
Dan Johansson,
***
This message is printed on 100% recycled electrons!
***


___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/


Re: [BackupPC-users] config.pl "built-in" script to backup Windows shares with Virtual Shadow Service Copy

2021-01-03 Thread backuppc
Dan Johansson wrote at about 14:24:25 +0100 on Sunday, January 3, 2021:
 > On 30.06.20 06:51, backu...@kosowsky.org wrote:
 > > Over the years, many have asked and struggled with backing up remote
 > > Windows shares with shadow copies. Shadow copies are useful since they
 > > allow both the backup to be 'consistent' and allow for reading files
 > > that are otherwise 'busy' and unreadable when part of active Windows
 > > partitions.
 > > 

 > I found this old email with the attached script.
 > I have tried to set it up, but sadly I can not get it to work. (:-(

Some details would be helpful...

> 
 > So now I have two questions.
 > 
 > a) What is the syntax of the "Conf{ClientShareName2Path}" hash? Examples?

$Conf{ClientShareName2Path} = {
'backuppc' => '/var/lib/backuppc',
'boot-efi' => '/boot/efi',
'home' => '/home',
'root' => '/',
};


> b) How shall the rsyncd be configured (rsyncd.conf, rsyncd.secrets)?

The script uses 'rsync' not 'rsyncd'
Not sure why you would ever want to use 'rsyncd' as it is less secure
(it uses a password 'secret' rather than a passphrase) and is more
complicated to setup than just running ssh over a background sshd daemon.


___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/


Re: [BackupPC-users] config.pl "built-in" script to backup Windows shares with Virtual Shadow Service Copy

2021-01-03 Thread Dan Johansson

On 30.06.20 06:51, backu...@kosowsky.org wrote:

Over the years, many have asked and struggled with backing up remote
Windows shares with shadow copies. Shadow copies are useful since they
allow both the backup to be 'consistent' and allow for reading files
that are otherwise 'busy' and unreadable when part of active Windows
partitions.

Various solutions (including one I proposed almost a decade ago) use
additional scripts and hacks to create the shadow copy.
Such solutions are kludgy and require the maintenance of separate
scripts either on the server or client.

I have written a combination of perl and bash code that can be stored
in the host.pl configuration file that does everything you need to
automagically create shadow copies for each share (where possible)
with minimal to no special configuration in host.pl and nothing to
configure on the Windows client (other than having cygwin+ssh+rsync
and an accessible account on your Windows client).

The only thing you need to do is to set up the hash
Conf{ClientShareName2Path} to map share names to their
(unshadowed) Windows paths. The attached script will then set up and
interpolate the appropriate shadow paths.

It should just work...
Just cut-and-paste the attachment into your host.pl code for Windows
clients.

Note: I included a fair amount of debugging & error messages in case
any shadows or links fail to get created or unwound.



___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/


I found this old email with the attached script.
I have tried to set it up, but sadly I can not get it to work. (:-(

So now I have two questions.

a) What is the syntax of the "Conf{ClientShareName2Path}" hash? Examples?
b) How shall the rsyncd be configured (rsyncd.conf, rsyncd.secrets)?

Regards,

--
Dan Johansson,
***
This message is printed on 100% recycled electrons!
***


___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/


Re: [BackupPC-users] config.pl "built-in" script to backup Windows shares with Virtual Shadow Service Copy

2020-07-02 Thread backuppc
usermail wrote at about 20:48:44 +1000 on Thursday, July 2, 2020:
 > On 30/6/20 2:51 pm, backu...@kosowsky.org wrote:
 > Wow great work! This would be fantastic functionality!
 > I copied it into my client .pl file but i dont know if ive stuffed it up?
 > My XferLOG starts like this:
 > 
 > XferLOG file /var/lib/backuppc/pc/charlotte/XferLOG.71.z created 2020-07-02 
 > 12:00:00
 > Backup prep: type = incr, case = 4, inPlace = 0, doDuplicate = 0, newBkupNum 
 > = 71, newBkupIdx = 7, lastBkupNum = 70, lastBkupIdx = 6 (FillCycle = 0, 
 > noFillCnt = 5)
 > Executing DumpPreUserCmd: &{sub {
 > my $timestamp = "20200702-12";
 > my $shadowdir = "/cygdrive/c/shadow/";
 > my $shadows = "";
 > 
 > my $bashscript = "function\ errortrap\ \ \{\ #NOTE:\ Trap\ on\ 
 > error:\ unwind\ shadows\ and\ exit\ 1.\
 > \ \ echo\ \"ERROR\ setting\ up\ shadows...\"\;\
 > \ \ \ \ #First\ delete\ any\ partially\ created\ shadows\
 > \ \ if\ \[\ -n\ \"\$SHADOWID\"\ \]\;\ then\
 > \ \ \ \ \ \ unset\ ERROR\;\
 > \ \ \ \ \ \ \(vssadmin\ delete\ shadows\ /shadow=\$SHADOWID\ /quiet\ \|\|\ 
 > ERROR=\"ERROR\ \"\)\ \|\ tail\ +4\;\  \   \   \ \ \ \ \ \
 > \ \ \ \ \ \ echo\ \"\ \ \ \$\{ERROR\}Deleting\ shadow\ copy\ for\ 
 > \'\$\{I\^\^\}:\'\ \$SHADOWID\"\;\
 > \ \ fi\
 > \ \ if\ \[\ -n\ \"\$SHADOWLINK\"\ \]\;\ then\
 > \ \ \ \ \ \ unset\ ERROR\;\
 > \ \ \ \ \ \ cmd\ /c\ rmdir\ \$SHADOWLINK\ \|\|\ ERROR=\"ERROR\ \"\;\
 > \ \ \ \ \ \ echo\ \"\ \ \ \$\{ERROR\}Deleting\ shadow\ link\ for\ 
 > \'\$\{I\^\^\}:\'\ \$SHADOWLINK\"\;\
 > \ \ fi\
 > 
 > The same on the client config page, is this likely an encoding or copy paste 
 > issue?

The backslashes are all painfully necessary to 'escape' variables,
special characters, and white space when passing to the shaell
> 
 > Second question, I dont use cygwin I use deltacopy (basically rsync compiled 
 > for windows I think)
 > and my RsyncShareName is /
 > I dont know perl but it looks like you trim the last slash off of $cygdrive, 
 > so will it be possible to
 > set $cygdrive to /

Yes. Or just set $cygdrive="";
Having this set wrong would explain why it is not automatically
finding your drive letters :)

> 
 > Thanks again for sharing your script,
 > Dean
 > 
 > 
 > 
 > 
 > ___
 > BackupPC-users mailing list
 > BackupPC-users@lists.sourceforge.net
 > List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
 > Wiki:http://backuppc.wiki.sourceforge.net
 > Project: http://backuppc.sourceforge.net/


___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/


Re: [BackupPC-users] config.pl "built-in" script to backup Windows shares with Virtual Shadow Service Copy

2020-07-02 Thread backuppc
Michael Stowe wrote at about 05:43:03 + on Thursday, July 2, 2020:
 > On 2020-06-30 19:35, backu...@kosowsky.org wrote:
 > > Michael Stowe wrote at about 23:09:55 + on Tuesday, June 30, 2020:
 > >  > On 2020-06-29 21:51, backu...@kosowsky.org wrote:
 > > Not sure why you would want to use a custom version of rsync when my
 > > pretty simple scripts do all that with a lot more transparency to how
 > > they are setup.
 > 
 > I think because it's just one binary (vsshadow not needed, nor anything 
 > else)

I don't need to add any binaries beyond rsync/ssh. I use the native
Win7/Win10 VSS to generate/unwind shadows including: vssadmin, wmic,
fsutil, mklink, rmdir). They were present on even the "Home" addition
of Windows.
 
 > > I believe it's far simpler and cleaner than either:
 > > - My old approach for WinXP (using a client-side triggered script,
 > >   rsyncd setup, dosdev, 'at' recursion to elevate privileges, etc.)
 > > - Your version requiring win.exe
 > > - Other versions requiring a custom/non-standard rsync
 > 
 > N.B.: my version works using ssh now, it doesn't require winexe
Good.
 > 
 > > My version only requires a basic cygwin install with rsync/ssh and
 > > basic linux utils plus built-in windows functions.
 > > 
 > > BTW, I still need to add back in the ability to dump all the acl's
 > > (using subinacl) since rsync only syncs POSIX acls and I believe ntfs
 > > has additional acl's.
 > > 
 > > In any case, my ultimate holy-grail is to be able to use BackupPC to 
 > > allow for
 > > a full bare-metal restore by combining:
 > > - Full VSS file backup
 > > - Restore of all ACLs from a subinacl dump
 > > - Anything else I may need to recreate the full NTFS filesystem for
 > >   windows (maybe disk signatures???)
 > 
 > I fully support this notion; NTFS has a lot of weirdness that doesn't 
 > translate well to rsync, like junction points.  Last time I tried these, 
 > rsync would convert them to symlinks, and restore them as symlinks.  
 > YMMV

Yes, you are right about junctions.
My plan would be to use 'fsutil' to get a list of reparsepoints that
could theoretically be reconstructed with 'mklink'.

Though perhaps fully recreating all the NTFS bells & whistles (or
oddities) is a fool's errand.


___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/


Re: [BackupPC-users] config.pl "built-in" script to backup Windows shares with Virtual Shadow Service Copy

2020-07-02 Thread usermail

On 30/6/20 2:51 pm, backu...@kosowsky.org wrote:

Over the years, many have asked and struggled with backing up remote
Windows shares with shadow copies. Shadow copies are useful since they
allow both the backup to be 'consistent' and allow for reading files
that are otherwise 'busy' and unreadable when part of active Windows
partitions.

Various solutions (including one I proposed almost a decade ago) use
additional scripts and hacks to create the shadow copy.
Such solutions are kludgy and require the maintenance of separate
scripts either on the server or client.

I have written a combination of perl and bash code that can be stored
in the host.pl configuration file that does everything you need to
automagically create shadow copies for each share (where possible)
with minimal to no special configuration in host.pl and nothing to
configure on the Windows client (other than having cygwin+ssh+rsync
and an accessible account on your Windows client).

The only thing you need to do is to set up the hash
Conf{ClientShareName2Path} to map share names to their
(unshadowed) Windows paths. The attached script will then set up and
interpolate the appropriate shadow paths.

It should just work...
Just cut-and-paste the attachment into your host.pl code for Windows
clients.

Note: I included a fair amount of debugging & error messages in case
any shadows or links fail to get created or unwound.


Wow great work! This would be fantastic functionality!
I copied it into my client .pl file but i dont know if ive stuffed it up?
My XferLOG starts like this:

XferLOG file /var/lib/backuppc/pc/charlotte/XferLOG.71.z created 2020-07-02 
12:00:00
Backup prep: type = incr, case = 4, inPlace = 0, doDuplicate = 0, newBkupNum = 
71, newBkupIdx = 7, lastBkupNum = 70, lastBkupIdx = 6 (FillCycle = 0, noFillCnt 
= 5)
Executing DumpPreUserCmd: &{sub {
   my $timestamp = "20200702-12";
   my $shadowdir = "/cygdrive/c/shadow/";
   my $shadows = "";

   my $bashscript = "function\ errortrap\ \ \{\ #NOTE:\ Trap\ on\ error:\ 
unwind\ shadows\ and\ exit\ 1.\
\ \ echo\ \"ERROR\ setting\ up\ shadows...\"\;\
\ \ \ \ #First\ delete\ any\ partially\ created\ shadows\
\ \ if\ \[\ -n\ \"\$SHADOWID\"\ \]\;\ then\
\ \ \ \ \ \ unset\ ERROR\;\
\ \ \ \ \ \ \(vssadmin\ delete\ shadows\ /shadow=\$SHADOWID\ /quiet\ \|\|\ 
ERROR=\"ERROR\ \"\)\ \|\ tail\ +4\;\   \   \   \ \ \ \ \ \
\ \ \ \ \ \ echo\ \"\ \ \ \$\{ERROR\}Deleting\ shadow\ copy\ for\ \'\$\{I\^\^\}:\'\ 
\$SHADOWID\"\;\
\ \ fi\
\ \ if\ \[\ -n\ \"\$SHADOWLINK\"\ \]\;\ then\
\ \ \ \ \ \ unset\ ERROR\;\
\ \ \ \ \ \ cmd\ /c\ rmdir\ \$SHADOWLINK\ \|\|\ ERROR=\"ERROR\ \"\;\
\ \ \ \ \ \ echo\ \"\ \ \ \$\{ERROR\}Deleting\ shadow\ link\ for\ \'\$\{I\^\^\}:\'\ 
\$SHADOWLINK\"\;\
\ \ fi\

The same on the client config page, is this likely an encoding or copy paste 
issue?

Second question, I dont use cygwin I use deltacopy (basically rsync compiled 
for windows I think)
and my RsyncShareName is /
I dont know perl but it looks like you trim the last slash off of $cygdrive, so 
will it be possible to
set $cygdrive to /

Thanks again for sharing your script,
Dean




___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/


Re: [BackupPC-users] config.pl "built-in" script to backup Windows shares with Virtual Shadow Service Copy

2020-07-01 Thread Michael Stowe

On 2020-06-30 19:35, backu...@kosowsky.org wrote:

Michael Stowe wrote at about 23:09:55 + on Tuesday, June 30, 2020:
 > On 2020-06-29 21:51, backu...@kosowsky.org wrote:
 > > Over the years, many have asked and struggled with backing up 
remote
 > > Windows shares with shadow copies. Shadow copies are useful since 
they
 > > allow both the backup to be 'consistent' and allow for reading 
files
 > > that are otherwise 'busy' and unreadable when part of active 
Windows

 > > partitions.
 > >
 > > Various solutions (including one I proposed almost a decade ago) 
use

 > > additional scripts and hacks to create the shadow copy.
 > > Such solutions are kludgy and require the maintenance of separate
 > > scripts either on the server or client.
 > >
 > > I have written a combination of perl and bash code that can be 
stored

 > > in the host.pl configuration file that does everything you need to
 > > automagically create shadow copies for each share (where possible)
 > > with minimal to no special configuration in host.pl and nothing to
 > > configure on the Windows client (other than having 
cygwin+ssh+rsync

 > > and an accessible account on your Windows client).
 > >
 > > The only thing you need to do is to set up the hash
 > > Conf{ClientShareName2Path} to map share names to their
 > > (unshadowed) Windows paths. The attached script will then set up 
and

 > > interpolate the appropriate shadow paths.
 > >
 > > It should just work...
 > > Just cut-and-paste the attachment into your host.pl code for 
Windows

 > > clients.
 > >
 > > Note: I included a fair amount of debugging & error messages in 
case

 > > any shadows or links fail to get created or unwound.
 >
 > What ssh do you use?

I just use stock cygwin ssh & rsync.


 > When I updated my server-side scripts to work with ssh as well as 
the

 > venerable winexe, and was alerted to this:
 >
https://u2182357.ct.sendgrid.net/ls/click?upn=UlfI6r-2FmuicX-2BnC5-2BZ3I6n1L3gGqkO4CpkrIpm-2FMXVdh7clCIBIMiVaW-2Fu4zJf1mu24301LW0nUuAE3Gedwg9vUvdiSjYTlleQn605qsb0FRbW6N7V7wfRFUjfSABVFV0RoZJ-2FyEfjb4YYEr-2F8znrwZSnSJzHNGDagX1i-2B8oxVVwIZ-2B-2BI-2B7fMNzIKJC5kqSEW-2F9D0DtlKHitvY1YisbM5pu2luUF-2B-2BItSFT8NuOX9Vq2dCJdKdjvFvOyTyyHxp1wW32cXKbNHSuWQQmnAIy9oD35Wau2-2B7WszpGgfR0cY-2B0pevu2W-2B-2B6fJJEznZrhlRitkK4PIwEk6rpHv5pNEE3zE6plvEiSsBUAzjqpeaPD-2BxvaMsO6aQJ9CXFTtDn8dUS5m6iatIhO0OYIAr3rlIP8HOuM8UxphdnUS-2Bx3cno2jam0S-2B-2B5lEewh0xiHIFUJ6ol867CfD3znalR13b0QgQk4L2VHC3hqf6DGABwIsLeze9isvhCs7r1nk59mpMhuTky2t-2BRoH9Mdm1KhWkz0czqEeXpfbtZjuSwPZeYgTcqMM-3D_4d7_ukiVZyKkp5Cjvx76jsH50UVUlXkseXbKCRkPqSLeHuHGH3U7CETSxfS6wuOOBk00pkNGxGGLZoFxeZBePnNNfQwoEtLwJoSFE-2FLY1sVDBZbSrzu7m0AdClCUvxzYM7KNHA9ZIEYhwveViz3D0A1qxuZ0VdWwC2Z2fJVSIP9x42x5tUhxpcmHt-2FjoSKP46YtZux-2F159UIJgD7q6ONjcVYeYEQdVYxxGrBNusnkQIrUHReWk9DtR-2B30KsApgurmA19

I don't use winexe - it's also not particularly secure.


No, nor do I.  But I do use the ssh that comes with Windows, which 
required some special handling to get the permissions right.  I don't 
know if your script will work with it, but I can give it a whirl within 
the week.



I pipe a server-side bash script onto ssh as part of the Dump Pre/Post
User Commands to setup and takedown the shadows.

Not sure why you would want to use a custom version of rsync when my
pretty simple scripts do all that with a lot more transparency to how
they are setup.


I think because it's just one binary (vsshadow not needed, nor anything 
else)



Can you test out my script?


I'll give it a shot (see above)


I believe it's far simpler and cleaner than either:
- My old approach for WinXP (using a client-side triggered script,
  rsyncd setup, dosdev, 'at' recursion to elevate privileges, etc.)
- Your version requiring win.exe
- Other versions requiring a custom/non-standard rsync


N.B.: my version works using ssh now, it doesn't require winexe


My version only requires a basic cygwin install with rsync/ssh and
basic linux utils plus built-in windows functions.

BTW, I still need to add back in the ability to dump all the acl's
(using subinacl) since rsync only syncs POSIX acls and I believe ntfs
has additional acl's.

In any case, my ultimate holy-grail is to be able to use BackupPC to 
allow for

a full bare-metal restore by combining:
- Full VSS file backup
- Restore of all ACLs from a subinacl dump
- Anything else I may need to recreate the full NTFS filesystem for
  windows (maybe disk signatures???)


I fully support this notion; NTFS has a lot of weirdness that doesn't 
translate well to rsync, like junction points.  Last time I tried these, 
rsync would convert them to symlinks, and restore them as symlinks.  
YMMV



___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/


Re: [BackupPC-users] config.pl "built-in" script to backup Windows shares with Virtual Shadow Service Copy

2020-06-30 Thread
Michael Stowe wrote at about 23:09:55 + on Tuesday, June 30, 2020:
 > On 2020-06-29 21:51, backu...@kosowsky.org wrote:
 > > Over the years, many have asked and struggled with backing up remote
 > > Windows shares with shadow copies. Shadow copies are useful since they
 > > allow both the backup to be 'consistent' and allow for reading files
 > > that are otherwise 'busy' and unreadable when part of active Windows
 > > partitions.
 > > 
 > > Various solutions (including one I proposed almost a decade ago) use
 > > additional scripts and hacks to create the shadow copy.
 > > Such solutions are kludgy and require the maintenance of separate
 > > scripts either on the server or client.
 > > 
 > > I have written a combination of perl and bash code that can be stored
 > > in the host.pl configuration file that does everything you need to
 > > automagically create shadow copies for each share (where possible)
 > > with minimal to no special configuration in host.pl and nothing to
 > > configure on the Windows client (other than having cygwin+ssh+rsync
 > > and an accessible account on your Windows client).
 > > 
 > > The only thing you need to do is to set up the hash
 > > Conf{ClientShareName2Path} to map share names to their
 > > (unshadowed) Windows paths. The attached script will then set up and
 > > interpolate the appropriate shadow paths.
 > > 
 > > It should just work...
 > > Just cut-and-paste the attachment into your host.pl code for Windows
 > > clients.
 > > 
 > > Note: I included a fair amount of debugging & error messages in case
 > > any shadows or links fail to get created or unwound.
 > 
 > What ssh do you use?

I just use stock cygwin ssh & rsync.


 > When I updated my server-side scripts to work with ssh as well as the 
 > venerable winexe, and was alerted to this:
 > https://u2182357.ct.sendgrid.net/ls/click?upn=UlfI6r-2FmuicX-2BnC5-2BZ3I6hSUAGKA-2FZ4EXu0KbZUYtfPMmjaEDrGQFZ-2BTO1Kw4YUsENnB-2BYHtkE8jsm5y9ZKsZw-3D-3D0WeR_ukiVZyKkp5Cjvx76jsH50UUtEtCgMsyWtxVptJl-2FKE9RHuXXjDv46hulGquMiCHqO1cUX7lUb0JGPDBkdKULRgIzBYzygPWOLMnToJEwWlkFgSpuyvyRIoFh6g46IkD4hDv8q0iNShGrbLZ-2FWY-2FJ1bf-2Br0AUhR4II3jmqK8V6zW-2BcNS3HWYTOsSxlK1I13DnsJSLHNRELiUUl7zLG4k9qlz2FMSSKC2P8WJDhyso0MU-3D

I don't use winexe - it's also not particularly secure.

I pipe a server-side bash script onto ssh as part of the Dump Pre/Post
User Commands to setup and takedown the shadows.

Not sure why you would want to use a custom version of rsync when my
pretty simple scripts do all that with a lot more transparency to how
they are setup.
> 
 > Which points to this:
 > https://u2182357.ct.sendgrid.net/ls/click?upn=UlfI6r-2FmuicX-2BnC5-2BZ3I6ixXxMXwHczMOYAFDcPlTkEXRK7t-2BnyUlyzDQoG5GZdN-2B0DCDb-2Fa6IOvkPW8bMfXFEiMGZijC6vabaR5CPfjOJA-3DAR1c_ukiVZyKkp5Cjvx76jsH50UUtEtCgMsyWtxVptJl-2FKE9RHuXXjDv46hulGquMiCHqEFL1iPvXcZ1RYzdaFNSnxeGPM-2Fl3J4b4K5FvLtwaS73kqtSTQPDxssk7g0TT-2BdnOGQvFBTfIuEx4PzfTiMDRUEgRPM9AXS4gEYEwBmCRXNkWAR5zS58ZQzEUZA2uzhKrR9gkTQZhcItZB2-2Fa897XTKax6LE2qXFlfEyJyh-2FGjhc-3D
 > 
 > Fundamentally, it's a customized copy of rsync that automatically 
 > handles the VSS side.  At any rate, I haven't finished testing it (have 
 > a large project backlog) but thought you (or others here) might be 
 > interested.

Can you test out my script?
I believe it's far simpler and cleaner than either:
- My old approach for WinXP (using a client-side triggered script,
  rsyncd setup, dosdev, 'at' recursion to elevate privileges, etc.)
- Your version requiring win.exe
- Other versions requiring a custom/non-standard rsync

My version only requires a basic cygwin install with rsync/ssh and
basic linux utils plus built-in windows functions.

BTW, I still need to add back in the ability to dump all the acl's
(using subinacl) since rsync only syncs POSIX acls and I believe ntfs
has additional acl's.

In any case, my ultimate holy-grail is to be able to use BackupPC to allow for
a full bare-metal restore by combining:
- Full VSS file backup
- Restore of all ACLs from a subinacl dump
- Anything else I may need to recreate the full NTFS filesystem for
  windows (maybe disk signatures???)


___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/


Re: [BackupPC-users] config.pl "built-in" script to backup Windows shares with Virtual Shadow Service Copy

2020-06-30 Thread Michael Stowe

On 2020-06-29 21:51, backu...@kosowsky.org wrote:

Over the years, many have asked and struggled with backing up remote
Windows shares with shadow copies. Shadow copies are useful since they
allow both the backup to be 'consistent' and allow for reading files
that are otherwise 'busy' and unreadable when part of active Windows
partitions.

Various solutions (including one I proposed almost a decade ago) use
additional scripts and hacks to create the shadow copy.
Such solutions are kludgy and require the maintenance of separate
scripts either on the server or client.

I have written a combination of perl and bash code that can be stored
in the host.pl configuration file that does everything you need to
automagically create shadow copies for each share (where possible)
with minimal to no special configuration in host.pl and nothing to
configure on the Windows client (other than having cygwin+ssh+rsync
and an accessible account on your Windows client).

The only thing you need to do is to set up the hash
Conf{ClientShareName2Path} to map share names to their
(unshadowed) Windows paths. The attached script will then set up and
interpolate the appropriate shadow paths.

It should just work...
Just cut-and-paste the attachment into your host.pl code for Windows
clients.

Note: I included a fair amount of debugging & error messages in case
any shadows or links fail to get created or unwound.


What ssh do you use?

When I updated my server-side scripts to work with ssh as well as the 
venerable winexe, and was alerted to this:

https://u2182357.ct.sendgrid.net/ls/click?upn=UlfI6r-2FmuicX-2BnC5-2BZ3I6hSUAGKA-2FZ4EXu0KbZUYtfPMmjaEDrGQFZ-2BTO1Kw4YUsENnB-2BYHtkE8jsm5y9ZKsZw-3D-3DOkUp_ukiVZyKkp5Cjvx76jsH50UVUlXkseXbKCRkPqSLeHuHGH3U7CETSxfS6wuOOBk00j-2B342fKCvTk2gVMjxlLeGQjGpYP9XfaFhqsh78hDEKLdOUOH4lHptqZI7uoYJ7-2BtzZLqYUcVXdPlHNtfoD3QBSgt3UEs1MGWPQzmfb3fOH7HbGctnY54CDgrSwj0qmmrglWL3EjG0PDiNOHaMCd6Ca1oincEGz6gUk00qqpETnyNz9sH0ZleDvOZCq6-2BLfbW

Which points to this:
https://u2182357.ct.sendgrid.net/ls/click?upn=UlfI6r-2FmuicX-2BnC5-2BZ3I6ixXxMXwHczMOYAFDcPlTkEXRK7t-2BnyUlyzDQoG5GZdN-2B0DCDb-2Fa6IOvkPW8bMfXFEiMGZijC6vabaR5CPfjOJA-3DZinR_ukiVZyKkp5Cjvx76jsH50UVUlXkseXbKCRkPqSLeHuHGH3U7CETSxfS6wuOOBk00j-2B342fKCvTk2gVMjxlLeGZHu7cPKYWx5IlIr5yRpXtHWrn5iGQubBaMv62yVZDPCU8oYXWCq30DGKiQ6yzxPxdV1ygz7XdIc-2FN9v6lUIeB9MDuiLXLcnutCzb-2FQPd-2Fcg-2FefTLzrbRTi1OxMVO1MSFVoLv4y1kwBN0s-2FUA7JfoepEk2hS1-2BVqr4yp7NwB4uvW

Fundamentally, it's a customized copy of rsync that automatically 
handles the VSS side.  At any rate, I haven't finished testing it (have 
a large project backlog) but thought you (or others here) might be 
interested.



___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/


Re: [BackupPC-users] config.pl "built-in" script to backup Windows shares with Virtual Shadow Service Copy

2020-06-30 Thread backuppc
G.W. Haywood via BackupPC-users wrote at about 15:38:42 +0100 on Tuesday, June 
30, 2020:
 > Hi there,
 > 
 > On Tue, 30 Jun 2020, Jeff Kosowsky wrote:
 > 
 > > It should just work...
 > > [snip]
 > > -- next part --
 > > A non-text attachment was scrubbed...
 > > Name: BackupPCShadowConfig.pl
 > > Type: application/octet-stream
 > > Size: 8533 bytes
 > > Desc: not available
 > > 
 > > --
 > 
 > Don't you just hate it when that happens? :)
 > 

Try it and let me know your feedback... :)


___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/


Re: [BackupPC-users] config.pl "built-in" script to backup Windows shares with Virtual Shadow Service Copy

2020-06-30 Thread G.W. Haywood via BackupPC-users

Hi there,

On Tue, 30 Jun 2020, Jeff Kosowsky wrote:


It should just work...
[snip]
-- next part --
A non-text attachment was scrubbed...
Name: BackupPCShadowConfig.pl
Type: application/octet-stream
Size: 8533 bytes
Desc: not available

--


Don't you just hate it when that happens? :)

--

73,
Ged.


___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/


[BackupPC-users] config.pl "built-in" script to backup Windows shares with Virtual Shadow Service Copy

2020-06-29 Thread
Over the years, many have asked and struggled with backing up remote
Windows shares with shadow copies. Shadow copies are useful since they
allow both the backup to be 'consistent' and allow for reading files
that are otherwise 'busy' and unreadable when part of active Windows
partitions.

Various solutions (including one I proposed almost a decade ago) use
additional scripts and hacks to create the shadow copy.
Such solutions are kludgy and require the maintenance of separate
scripts either on the server or client.

I have written a combination of perl and bash code that can be stored
in the host.pl configuration file that does everything you need to
automagically create shadow copies for each share (where possible)
with minimal to no special configuration in host.pl and nothing to
configure on the Windows client (other than having cygwin+ssh+rsync
and an accessible account on your Windows client).

The only thing you need to do is to set up the hash
Conf{ClientShareName2Path} to map share names to their 
(unshadowed) Windows paths. The attached script will then set up and
interpolate the appropriate shadow paths.

It should just work...
Just cut-and-paste the attachment into your host.pl code for Windows
clients.

Note: I included a fair amount of debugging & error messages in case
any shadows or links fail to get created or unwound.



BackupPCShadowConfig.pl
Description: Binary data
___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/