Compare commits

...

13 Commits

Author SHA1 Message Date
Daniel Berteaud a5356d71eb Automatic commit of package [BackupPC-server-scripts] minor release [0.1.4-3].
Created by command:

/usr/bin/tito tag
2022-01-11 16:34:06 +01:00
Daniel Berteaud 4dc56a7681 Automatic commit of package [BackupPC-server-scripts] minor release [0.1.4-2].
Created by command:

/usr/bin/tito tag
2021-12-09 11:05:49 +01:00
Daniel Berteaud a64e44f771 Use ReleaseTagger 2021-12-09 11:05:39 +01:00
Daniel Berteaud 12769d743d Automatic commit of package [BackupPC-server-scripts] release [0.1.4-1].
Created by command:

/usr/bin/tito tag --use-release 1%{?dist} --no-auto-changelog
2018-08-21 11:47:20 +02:00
Daniel Berteaud 5b3786fb5b Automatic commit of package [BackupPC-server-scripts] release [0.1.3-0.beta1].
Created by command:

/usr/bin/tito tag --use-release 0.beta1%{?dist}
2018-08-21 11:37:58 +02:00
Daniel Berteaud 37669bdf1c Set timeout to 900
On big and busy servers, 300 can be too short
2018-08-21 11:36:52 +02:00
Daniel Berteaud 31793021cf Configure tito 2018-08-21 11:36:18 +02:00
Daniel Berteaud 6ce2f4e1dd Initialized to use tito. 2018-08-21 11:33:16 +02:00
Daniel Berteaud cc6cf05c9b Adapt specfile for tito 2018-08-21 11:33:08 +02:00
Daniel Berteaud 597b32246d Spec file update 2015-09-17 11:00:26 +02:00
Daniel Berteaud 37179cfdf3 Adapt winexe command so it works with v1.1 2015-09-16 16:39:29 +02:00
Daniel Berteaud 1a4437ab39 update spec file 2013-04-04 13:24:23 +02:00
Daniel Berteaud c4f6c63b5a Add a timeout on winexe call so the pre-backup commands cannot hang indefinitely. The version of timeout is only included on RHEL 5 because in EL6, coreutils provides one 2013-04-04 11:34:29 +02:00
8 changed files with 96 additions and 13 deletions

3
.tito/packages/.readme Normal file
View File

@ -0,0 +1,3 @@
the .tito/packages directory contains metadata files
named after their packages. Each file has the latest tagged
version and the project's relative directory.

View File

@ -0,0 +1 @@
0.1.4-3 ./

1
.tito/releasers.conf Symbolic link
View File

@ -0,0 +1 @@
../../tito_libs/releasers.conf

6
.tito/tito.props Normal file
View File

@ -0,0 +1,6 @@
[buildconfig]
builder = tito.builder.Builder
tagger = tito.tagger.ReleaseTagger
changelog_do_not_remove_cherrypick = 0
changelog_format = %s (%ae)
lib_dir = ../tito_libs

View File

@ -1,10 +1,6 @@
%define name BackupPC-server-scripts
%define version 0.1.0
%define release 1
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
Name: BackupPC-server-scripts
Version: 0.1.4
Release: 3%{?dist}
Summary: Some scripts for a BackupPC server
Group: Applications/System
@ -22,6 +18,18 @@ Provides some scripts to run a a BackupPC server.
Like pre-backup scripts for Windows boxes
%changelog
* Tue Jan 11 2022 Daniel Berteaud <dbd@ehtrace.com> 0.1.4-3
- Release bump
* Thu Dec 09 2021 Daniel Berteaud <dani@lapiole.org> 0.1.4-2
- Use ReleaseTagger (dani@lapiole.org)
* Tue Aug 21 2018 Daniel Berteaud <daniel@firewall-services.com> 0.1.4-1
- new package built with tito
- Default timeout is now 900
* Wed Sep 16 2015 Daniel Berteaud <daniel@firewall-services.com> - 0.1.2-1
- Adapt winexe commandline args so it works with winexe 1.1
* Thu Jul 5 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.1.0
- initial release
@ -35,7 +43,13 @@ Like pre-backup scripts for Windows boxes
# Install backup script
%{__mkdir_p} $RPM_BUILD_ROOT%{_bindir}/
%{__install} -m 0755 scripts/* $RPM_BUILD_ROOT%{_bindir}/
%{__install} -m 0755 scripts/win-* $RPM_BUILD_ROOT%{_bindir}/
# coreutils doesn't provides a timeout command in EL5
# So include the bash one
%if 0%{?rhel} == 5
%{__install} -m 0755 scripts/timeout $RPM_BUILD_ROOT%{_bindir}/
%endif
# Install conf
%{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/BackupPC
@ -46,7 +60,6 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc CHANGELOG.git
%{_bindir}/*
%config(noreplace) %attr(0640, root, backuppc) %{_sysconfdir}/BackupPC/*

53
scripts/timeout Normal file
View File

@ -0,0 +1,53 @@
#Newsgroups: comp.unix.admin,comp.unix.solaris,comp.unix.shell
#From: gwc@root.co.uk (Geoff Clare)
#Subject: Re: timeout -t <sec> <unix command> (Re: How to give rsh a shorter timeout?)
#Message-ID: <EoBxrs.223@root.co.uk>
#Date: Fri, 13 Feb 1998 18:23:52 GMT
#
# Conversion to bash v2 syntax done by Chet Ramey <chet@po.cwru.edu
# UNTESTED
#
prog=${0##*/}
usage="usage: $prog [-signal] [timeout] [:interval] [+delay] [--] <command>"
SIG=-TERM # default signal sent to the process when the timer expires
timeout=60 # default timeout
interval=15 # default interval between checks if the process is still alive
delay=2 # default delay between posting the given signal and
# destroying the process (kill -KILL)
while :
do
case $1 in
--) shift; break ;;
-*) SIG=$1 ;;
[0-9]*) timeout=$1 ;;
:*) EXPR='..\(.*\)' ; interval=`expr x"$1" : "$EXPR"` ;;
+*) EXPR='..\(.*\)' ; delay=`expr x"$1" : "$EXPR"` ;;
*) break ;;
esac
shift
done
case $# in
0) echo "$prog: $usage" >&2 ; exit 2 ;;
esac
(
for t in $timeout $delay
do
while (( $t > $interval ))
do
sleep $interval
kill -0 $$ || exit
t=$(( $t - $interval ))
done
sleep $t
kill $SIG $$ && kill -0 $$ || exit
SIG=-KILL
done
) 2> /dev/null &
exec "$@"

View File

@ -9,11 +9,14 @@ if [ ! -z $3 ]; then
PASS=$3
fi
# Timeout after 15 minutes
TIMEOUT=900
BOX=$1
if [[ ! -z $UNAME && ! -z $PASS ]]; then
$WINEXE -s /dev/null -U $UNAME --password=$PASS //$BOX 'cmd /c echo '1' > c:\backuppc\wake.up' <&-
/usr/bin/timeout $TIMEOUT $WINEXE -U $UNAME%$PASS //$BOX 'cmd /c echo '1' > c:\backuppc\wake.up' <&-
else
$WINEXE -s /dev/null --authentication-file=/etc/BackupPC/win.conf //$BOX 'cmd /c echo '1' > c:\backuppc\wake.up' <&-
/usr/bin/timeout $TIMEOUT $WINEXE --authentication-file=/etc/BackupPC/win.conf //$BOX 'cmd /c echo '1' > c:\backuppc\wake.up' <&-
fi
echo "Rsync and shadow copy unloaded"

View File

@ -7,12 +7,15 @@ if [ ! -z $3 ]; then
PASS=$3
fi
# Timeout after 15 minutes
TIMEOUT=900
BOX=$1
if [[ ! -z $UNAME && ! -z $PASS ]]; then
/usr/bin/winexe -s /dev/null --interactive=0 -U $UNAME --password=$PASS //$BOX 'cmd /c c:\backuppc\pre-exec.cmd' <&- || exit 255
/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/winexe -s /dev/null --interactive=0 --authentication-file=/etc/BackupPC/win.conf //$BOX 'cmd /c c:\backuppc\pre-exec.cmd' <&- || exit 255
/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"