Michael,
Which binaries that you've packaged are you referring to and if needed
where can I find them?
Thanks
Pete
On 3/12/20 1:26 AM, Michael Stowe wrote:
With each security update and version bump of Samba, winexe is
becoming more and more finicky, so I thought it time to see if
Window's own ssh could be used for the same purpose. While it's not
as straightforward as I'd hoped, it does work and doesn't require
anything other than the binaries I'd already packaged for the purpose.
This is the script executed with $Conf{DumpPreUserCmd}:
|#!/bin/bash
#
# Takes one parameter, the name of the system
#
BOX=$1
/usr/bin/ssh Administrator@$BOX <mailto:Administrator@$BOX>
'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Invoke-WmiMethod -Class Win32_Process -EnableAllPrivileges -Name
Create -ArgumentList \"cmd /c c:\backuppc\pre-exec.cmd\"'
# The above command is running in the background, we need to wait for
rsync
# to start
let i=0
while [ $i -le 72 ]; do
PIDEXISTS=$(ssh Administrator@carrot <mailto:Administrator@carrot>
'dir C:\BackupPC\rsyncd.pid' |& grep -v "^ Volume" | grep -v "^
Directory" | grep -o rsyncd.pid)
if [ "$PIDEXISTS" == "rsyncd.pid" ]; then
i=-1
break
fi
echo -n "."
sleep 5
done
if [ $i -eq -1 ]; then
echo ""
echo "Rsync and shadow copy loaded"
exit 0
else
echo "Error loading rsync"
exit 1
fi|
This assumes that one has installed the ssh server that comes with
Windows, and set up key authentication. Note that it's necessary to
use an account with Administrative privileges in order to have the
requisite permissions.
$Conf{DumpPostUserCmd} is more straightforward:
|#!/bin/bash
/usr/bin/ssh Administrator@$BOX 'cmd /c echo '1' >
c:\backuppc\wake.up' <&-
|
Web Bug from
https://u2182357.ct.sendgrid.net/wf/open?upn=OypFYCWzG5ApGW-2FFpGTxc4RCS9eud0Dl1htN5rYoUZ8To4zeNUFBkAGI3hzer91CxoAWCKQXVN-2B-2BnnWbk764ekxmYv0YRAl8lYtRZ-2B2Sz-2BLoXcNb03UBw4AvRnKD0-2B9ty9GIqEM29wDaI41bFajCO-2F-2BmkwkRnnWd3N6jPbtnDgbm98WIedrMQHSkd-2FkfikRrdt4nhZSGrEJwaxalGcsPtPCPyVSNV-2BSlYD48ABdw0mfJBN35nJL96evKzDJNFVWsjyXAmYF2r29pDudIwt8-2FVg-3D-3D
--
This message has been scanned for viruses and
dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
believed to be clean.
_______________________________________________
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/
--
Unencumbered by the thought process.
-- Click and Clack the Tappet brothers
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
_______________________________________________
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/