[go: up one dir, main page]

File: write_data_src

package info (click to toggle)
kbackup 1.2.11-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 716 kB
  • ctags: 294
  • sloc: sh: 4,664; ansic: 1,595; makefile: 113; lisp: 37
file content (65 lines) | stat: -rw-r--r-- 1,804 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh
#
# $Header: /home/kbackup/CVSROOT/KBackup/src/write_data_src,v 1.20 1997/09/19 19:49:25 kbackup Exp $
#
# This file is Copyright (C) 1995-1997 by Karsten Ballder (Ballueder@usa.net)
#
# It is part of the KBackup package, see the file COPYING for details.
# KBackup and all files included in this package are licensed and protected
# under the terms and conditions of the GNU General Public License Version 2.
#
#	If you want to contact the current maintainer of this software, please
#	send e-mail to: KBackup@usa.net
#
#	function to reliably write data to tape, including double buffering
#	and multi-volume handling [DB+multivol w/ multibuf only]
#

WriteData_src_loaded=YES

write_data()
{
	if [ "$1" = "-raw" ]
	then
		shift
		if [ "$1" != "" ]
		then
			wdfile="$1"
		else
			wdfile="$device"
		fi
		multibuf_cmd=`echo $DD of=$wdfile ibs=$syncto conv=sync`
	else
		if [ "$1" != "" ]
		then
			wdfile="$1"
		else
			wdfile="$device"
		fi
		if [ "$use_multibuf" = "YES" ]
		then
			set_multibuf_options WRITE
			multibuf_cmd=`echo "$MULTIBUF $multibuf_options -b $multibuf_blksize -n $multibuf_nblocks $wdfile" `
		else
			multibuf_cmd=`echo $DD of=$wdfile ibs=$syncto conv=sync `
		fi
	fi	
	

	if [ "$remote_mode" = "YES" ]
	then
		last_command="su in write_data()"
		cat $TMP/$MBUF_SCRIPT1 | su $remote_uid -c "rsh $remote_host \"cat >$TMP/$MBUF_SCRIPT1\"" 
		cat $TMP/$MBUF_SCRIPT2 | su $remote_uid -c "rsh $remote_host \"cat >$TMP/$MBUF_SCRIPT2\"" 
		cat $TMP/$MBUF_SCRIPTR | su $remote_uid -c "rsh $remote_host \"cat >$TMP/$MBUF_SCRIPTR\"" 
		su $remote_uid -c "rsh $remote_host \"$DD ibs=$multibuf_blksize conv=sync | $multibuf_cmd ; sleep 10\""
	else
		last_command="$DD and multibuf in write_data()"
		`echo $multibuf_cmd` 2>$STDERR
		check_error
	fi
	mysleep 5	# for tpqic02
}