4 \section*{Data Spooling}
6 \index[general]{Data Spooling }
7 \index[general]{Spooling!Data }
8 \addcontentsline{toc}{section}{Data Spooling}
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
15 \item It can 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 start
17 and stop or shoe-shine as it is often called causing tape wear. By first
18 writing the data to disk, then writing it to tape, the tape can be kept in
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 multiple
22 simultaneous jobs to disk, then have them very efficiently despooled one at a
23 time without having the data blocks from several jobs intermingled, thus
24 substantially improving the time needed to restore files.
25 \item Writing to a tape can be slow. By first spooling your data to disk, you
26 can often reduce the time the File daemon is running on a system, thus
27 reducing downtime, and/or interference with users.
30 Data spooling is exactly that ``spooling''. It is not a way to first write a
31 ``backup'' to a disk file and then to a tape. When the backup has only been spooled to disk,
32 it is not complete yet and cannot be restored until it is written to tape. In a
33 future version, Bacula will support writing a backup to disk then later {\bf
34 Migrating} or {\bf Copying} it to a tape.
36 The remainder of this chapter explains the various directives that you can use
37 in the spooling process.
40 \subsection*{Data Spooling Directives}
41 \index[general]{Directives!Data Spooling }
42 \index[general]{Data Spooling Directives }
43 \addcontentsline{toc}{subsection}{Data Spooling Directives}
45 The following directives can be used to control data spooling.
48 \item To turn data spooling on/off at the Job level in the Job resource in
49 the Director's conf file (default {\bf no}).
51 {\bf SpoolData = yes|no}
52 \item To override the Job specification in a Schedule Run directive in the
55 {\bf SpoolData = yes|no}
56 \item To limit the maximum total size of the spooled data for a particular
57 device. Specified in the Device resource of the Storage daemon's conf file
60 {\bf Maximum Spool Size = size}
62 Where size is a the maximum spool size for all jobs specified in bytes.
63 \item To limit the maximum total size of the spooled data for a particular
64 device for a single job. Specified in the Device Resource of the Storage
65 daemon's conf file (default unlimited).
67 {\bf Maximum Job Spool Size = size}
69 Where size is the maximum spool file size for a single job specified in
71 \item To specify the spool directory for a particular device. Specified in
72 the Device Resource of the Storage daemon's conf file (default, the working
75 {\bf Spool Directory = directory}
80 \subsection*{!!! MAJOR WARNING !!!}
81 \index[general]{WARNING! MAJOR }
82 \index[general]{ MAJOR WARNING }
83 \addcontentsline{toc}{subsection}{MAJOR WARNING !!!}
85 Please be very careful to exclude the spool directory from any backup,
86 otherwise, your job will write enormous amounts of data to the Volume, and
87 most probably terminate in error. This is because in attempting to backup the
88 spool file, the backup data will be written a second time to the spool file,
89 and so on ad infinitum.
91 Another advice is to always specify the maximum spool size so that your disk
92 doesn't completely fill up. In principle, data spooling will properly detect a
93 full disk, and despool data allowing the job to continue. However, attribute
94 spooling is not so kind to the user. If the disk on which attributes are being
95 spooled fills, the job will be canceled.
98 \subsection*{Other Points}
99 \index[general]{Points!Other }
100 \index[general]{Other Points }
101 \addcontentsline{toc}{subsection}{Other Points}
104 \item When data spooling is enabled, Bacula automatically turns on attribute
105 spooling. In other words, it also spools the catalog entries to disk. This is
106 done so that in case the job fails, there will be no catalog entries
107 pointing to non-existent tape backups.
108 \item Attribute despooling is done at the end of the job, as a consequence,
109 after Bacula stops writing the data to the tape, there may be a pause while
110 the attributes are sent to the Directory and entered into the catalog before
112 \item Attribute spool files are always placed in the working directory.
113 \item When Bacula begins despooling data spooled to disk, it takes exclusive
114 use of the tape. This has the major advantage that in running multiple
115 simultaneous jobs at the same time, the blocks of several jobs will not be
117 \item It probably does not make a lot of sense to enable data spooling if you
118 are writing to disk files.
119 \item It is probably best to provide as large a spool file as possible to
120 avoid repeatedly spooling/despooling. Also, while a job is despooling to
121 tape, the File daemon must wait (i.e. spooling stops for the job while it is
123 \item If you are running multiple simultaneous jobs, Bacula will continue
124 spooling other jobs while one is despooling to tape, provided there is
125 sufficient spool file space.