File: secrestore

package info (click to toggle)
afio 2.5-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 616 kB
  • ctags: 475
  • sloc: ansic: 4,678; sh: 535; makefile: 127; awk: 19
file content (92 lines) | stat: -rwxr-xr-x 2,499 bytes parent folder | download | duplicates (5)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/sh
patternfile="/root/bin/secrestoreonly.pattern"
###Syntax example for such a patternfile:
###>>>>>>>>>>>>>secrestoreonly.pattern>>>>>>>>>>>>>>>>>
###
###/root/*
###*/packages/*
###
###<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


#This is the file where your passphrase is stored.
passphrasefile="/root/bin/secbak.tmpdir/secbak.parms"

#this is needed when you use pgp 
export RANDSEED="~/.pgp/randseed.bin"
export PGPPASSFD=3
export TMP="/root/bin/secbak.tmpdir"

### Remark
### You don't need afio to restore the contents of an afio archive. Try  
###		cpio -i /dev/fd0
### Remark: it doesn't decompress and decipher automatically and it 
### doesn't write under $pwd


### Restore all files under this directory 
cd /tmp

### If you use a tape don't forget to wind it back at
### the beginning of your achive. Use something like  
###  	 mt -f /dev/nst0 rewind





#################uncomment one example only

###	use this to restore only parts of an archive
#afio -ivzZ -w $patternfile /dev/nst0
###	to restore the complete contents remove: -w $patternfile

### 	use this to restore a pgp-encrypted archive 
#	from tape
#afio -ivzZ -P pgp -Q -f -Q +verbose=0 -3 3 /dev/nst0 \
#	 3<$passphrasefile

### 	The same, but for GnuPG 
#afio -ivzZ -P gpg -3 3 -Q --decrypt \
#	-Q --no-options -Q --batch \
#	-Q --passphrase-fd=3 -Q --no-verbose /dev/nst0 \
#	3<$passphrasefile
###	to restore the complete contents remove: -w $patternfile




### 	The next is for multi-volumn pgp-encrypted archives on HD floppies 
#afio -ivzZ -s 1440k -w $patternfile  -P pgp -Q -f -Q +verbose=0 \
#	-3 3 /dev/fd0 \
#	3<$passphrasefile
###	to restore the complete contents remove: -w $patternfile

### 	The same, but for GnuPG 
#afio -ivzZ -s 1440k -w $patternfile  -P gpg -3 3 -Q --decrypt \
#	-Q --no-options -Q --batch \
#	-Q --passphrase-fd=3 -Q --no-verbose /dev/fd0 \
#	3<$passphrasefile
###	to restore the complete contents remove: -w $patternfile





### 	If you have stored your archive in a named file use this 
#	and call this script by : 	secrestore /PATH/archivefile
afio -ivzZ $1 

### 	If you have stored your pgp encrypted archive in a named 
###	file use this and call this
### 	script by : 		secrestore /PATH/archivefile
#afio -ivzZ -P pgp -Q -f -Q +verbose=0 -3 3 $1 3<$passphrasefile

###	The same but for GnuPG
#afio -ivzZ -P gpg -3 3 -Q --decrypt -Q --no-options -Q --batch \
#	-Q --passphrase-fd=3 -Q --no-verbose $1 \
#	3<$passphrasefile



#end of uncomment one example only