]> git.sur5r.net Git - bacula/docs/blob - docs/manual/spooling.tex
Final changes
[bacula/docs] / docs / manual / spooling.tex
1 %%
2 %%
3
4 \section*{Data Spooling}
5 \label{SpoolingChapter}
6 \index[general]{Data Spooling }
7 \index[general]{Spooling!Data }
8 \addcontentsline{toc}{section}{Data Spooling}
9
10 Bacula allows you to specify that you want the Storage daemon to initially
11 write your data to disk and then subsequently to tape. This serves several
12 important purposes. 
13
14 \begin{itemize}
15 \item It take a long time for data to come in from the File daemon during
16    an Incremental backup.  If it is directly written to tape, the tape will
17    start and stop or shoe-shine as it is often called causing tape wear.
18    By first writing the data to disk, then writing it to tape, the tape can
19    be kept in continual motion.
20 \item While the spooled data is being written to the tape, the despooling
21    process has exclusive use of the tape.  This means that you can spool
22    multiple simultaneous jobs to disk, then have them very efficiently
23    despooled one at a time without having the data blocks from several jobs
24    intermingled, thus substantially improving the time needed to restore
25    files. While despooling, all jobs spooling continue running.
26 \item Writing to a tape can be slow.  By first spooling your data to disk,
27    you can often reduce the time the File daemon is running on a system,
28    thus reducing downtime, and/or interference with users.  Of course, if
29    your spool device is not large enough to hold all the data from your
30    File daemon, you may actually slow down the overall backup.
31 \end{itemize}
32
33 Data spooling is exactly that "spooling".  It is not a way to first write a
34 "backup" to a disk file and then to a tape.  When the backup has only been
35 spooled to disk, it is not complete yet and cannot be restored until it is
36 written to tape.  In a future version, Bacula will support writing a backup
37 to disk then later {\bf Migrating} or {\bf Copying} it to a tape.
38
39 The remainder of this chapter explains the various directives that you can use
40 in the spooling process. 
41 \label{directives}
42
43 \subsection*{Data Spooling Directives}
44 \index[general]{Directives!Data Spooling }
45 \index[general]{Data Spooling Directives }
46 \addcontentsline{toc}{subsection}{Data Spooling Directives}
47
48 The following directives can be used to control data spooling. 
49
50 \begin{itemize}
51 \item To turn data spooling on/off at the Job level in  the Job resource in
52    the Director's conf file (default  {\bf no}).
53
54 {\bf SpoolData = yes|no} 
55
56 \item To override the Job specification in a Schedule Run  directive in the
57    Director's conf file.
58
59 {\bf SpoolData = yes|no} 
60
61 \item To limit the maximum total size of the spooled data  for a particular
62    device. Specified in the Device  resource of the Storage daemon's conf file
63    (default  unlimited).
64
65 {\bf Maximum Spool Size = size}
66    Where size is a the maximum spool size for all jobs  specified in bytes. 
67
68 \item To limit the maximum total size of the spooled data  for a particular
69    device for a single job. Specified  in the Device Resource of the Storage
70    daemon's conf  file (default unlimited).
71
72 {\bf Maximum Job Spool Size = size}
73    Where size is the maximum spool file size for a single  job specified in
74    bytes. 
75
76 \item To specify the spool directory for a particular device.  Specified in
77    the Device Resource of the Storage daemon's conf  file (default, the working
78    directory).
79
80 {\bf Spool Directory = directory} 
81 \end{itemize}
82
83 \label{warning}
84
85 \subsection*{!!! MAJOR WARNING !!!}
86 \index[general]{WARNING! MAJOR }
87 \index[general]{ MAJOR WARNING  }
88 \addcontentsline{toc}{subsection}{MAJOR WARNING !!!}
89
90 Please be very careful to exclude the spool directory from any backup,
91 otherwise, your job will write enormous amounts of data to the Volume, and
92 most probably terminate in error. This is because in attempting to backup the
93 spool file, the backup data will be written a second time to the spool file,
94 and so on ad infinitum. 
95
96 Another advice is to always specify the maximum spool size so that your disk
97 doesn't completely fill up. In principle, data spooling will properly detect a
98 full disk, and despool data allowing the job to continue. However, attribute
99 spooling is not so kind to the user. If the disk on which attributes are being
100 spooled fills, the job will be canceled. In addition, if your working 
101 directory is on the same partition as the spool directory, then Bacula jobs
102 will fail possibly in bizarre ways when the spool fills.
103
104 \label{points}
105 \subsection*{Other Points}
106 \index[general]{Points!Other }
107 \index[general]{Other Points }
108 \addcontentsline{toc}{subsection}{Other Points}
109
110 \begin{itemize}
111 \item When data spooling is enabled, Bacula automatically  turns on attribute
112    spooling. In other words, it also  spools the catalog entries to disk. This is
113    done so  that in case the job fails, there will be no catalog  entries
114    pointing to non-existent tape backups. 
115 \item Attribute despooling is done at the end of the job, as  a consequence,
116    after Bacula stops writing the data to  the tape, there may be a pause while
117    the attributes are sent  to the Directory and entered into the catalog before 
118    the job terminates. 
119 \item Attribute spool files are always placed in the  working directory. 
120 \item When Bacula begins despooling data spooled to disk, it  takes exclusive
121    use of the tape. This has the major  advantage that in running multiple
122    simultaneous jobs at  the same time, the blocks of several jobs will not be 
123    intermingled. 
124 \item It probably does not make a lot of sense to enable data  spooling if you
125    are writing to disk files. 
126 \item It is probably best to provide as large a spool file as  possible to
127    avoid repeatedly spooling/despooling. Also,  while a job is despooling to
128    tape, the File daemon must wait  (i.e. spooling stops for the job while it is 
129    despooling).  
130 \item If you are running multiple simultaneous jobs, Bacula  will continue
131    spooling other jobs while one is despooling  to tape, provided there is
132    sufficient spool file space. 
133 \end{itemize}