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