]> git.sur5r.net Git - bacula/bacula/blob - bacula/examples/conf/many-clients.txt
Implement RestoreObject for sqlite + cleanups
[bacula/bacula] / bacula / examples / conf / many-clients.txt
1 From: Dan Langille <dan@langille.org>
2 To: bacula-devel@lists.sourceforge.net
3 Subject: [Bacula-devel] script for creating many client FDs
4 Date Tue, 2 Dec 2003 19:41:28 -0500 (EST)
5
6 I created this script which may be useful to others.  If you have to
7 create a bacula-fd.conf file for more than a few clients, it can become
8 time consuming, not to mention error prone.
9
10 Here is the usage:
11
12 $ sh client-build.sh
13 client-build.sh : usage client-build.sh DIRNAME DIRPASSWD CLIENTNAME
14 [CLIENTNAME...]
15
16 Where DIRNAME is the director name which can contact this client
17       PASSWD  is the passwd to be supplied by the director
18       CLIENTNAME is the name of the client file daemon
19
20 The script creates ./tmp and places all output there.
21
22 bacula-fd.conf.in is the template it uses for creating the client scripts
23 and it must reside in the same directory as the script.
24
25 Enjoy
26 -- 
27 Dan Langille - http://www.langille.org/
28
29 ==== bacula-fd.conf.in template ======
30 #
31 # Default  Bacula File Daemon Configuration file
32 #
33 #  For Bacula release 1.32b (14 Oct 2003) -- freebsd 4.8-STABLE
34 #
35 # There is not much to change here except perhaps the
36 # File daemon Name to
37 #
38
39 #
40 # List Directors who are permitted to contact this File daemon
41 #
42 Director {
43   Name     = @dir-name@
44   Password = "@dir-password@"
45 }
46
47 #
48 # "Global" File daemon configuration specifications
49 #
50 FileDaemon {
51   Name             = @client-name@
52   FDport           = 9102          # where we listen for the director
53   WorkingDirectory = /var/db/bacula
54   Pid Directory    = /var/run
55 }
56
57 # Send all messages except skipped files back to Director
58 Messages {
59   Name     = Standard
60   director = undef-dir = all, !skipped
61 }
62 === end bacula-fd.conf.in template ========
63
64
65 ==== client-build.sh ===========
66 #!/bin/sh
67 #
68 # Copyright 2003 Dan Langille <dan@langille.org>
69 #
70 # Use as you wish, but keep retain this copyright notice.
71 # Please forward improvements.
72 #
73 # usage client-build.sh DIRNAME DIRPASSWD CLIENTNAME [CLIENTNAME...]
74 #
75 # Where DIRNAME is the director name which can contact this client
76 #       PASSWD  is the passwd to be supplied by the director
77 #       CLIENTNAME is the name of the client file daemon
78 #
79 # This script creates ./tmp and places all output there.
80 #
81 # bacula-fd.conf.in is the template it uses for creating the client scripts.
82 #
83
84
85 if [ $# -lt 3 ]
86 then
87    echo $0 : usage $0 DIRNAME DIRPASSWD CLIENTNAME [CLIENTNAME...]
88    exit 1
89 fi
90
91 mkdir -p ./tmp
92
93 DIRNAME=$1
94 DIRPASSWD=$2
95
96 shift 2
97
98 echo creating stuff for $DIRNAME with password $DIRPASSWD
99
100 while [ $# -gt 0 ] ; do
101         CLIENT=$1
102         shift
103         echo "creating config for " $CLIENT
104         sed "s/@dir-name@/undef-dir/;s/@dir-password@/password/;s/@client-name@/$CLIENT/" bacula-fd.conf.in > ./tmp/$CLIENT-bacula-fd.conf
105 done
106 === end client-build.sh ===============