Server side scripts for BackupPC
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
527 B

#!/bin/bash
if [ ! -z $2 ]; then
UNAME=$2
fi
if [ ! -z $3 ]; then
PASS=$3
fi
# Timeout after 15 minutes
TIMEOUT=900
BOX=$1
if [[ ! -z $UNAME && ! -z $PASS ]]; then
/usr/bin/timeout $TIMEOUT /usr/bin/winexe --interactive=0 -U $UNAME%$PASS //$BOX 'cmd /c c:\backuppc\pre-exec.cmd' <&- || exit 255
else
/usr/bin/timeout $TIMEOUT /usr/bin/winexe --interactive=0 --authentication-file=/etc/BackupPC/win.conf //$BOX 'cmd /c c:\backuppc\pre-exec.cmd' <&- || exit 255
fi
sleep 5
echo "Rsync and shadow copy loaded"