4 \chapter{Data Spooling}
5 \label{SpoolingChapter}
6 \index[general]{Data Spooling }
7 \index[general]{Spooling!Data }
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
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.
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
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
40 details on this, please see the \ilink{Migration}{MigrationChapter} chapter
41 of this manual for more details.
43 The remainder of this chapter explains the various directives that you can use
44 in the spooling process.
47 \section{Data Spooling Directives}
48 \index[general]{Directives!Data Spooling }
49 \index[general]{Data Spooling Directives }
51 The following directives can be used to control data spooling.
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}).
57 {\bf SpoolData = yes\vb{}no}
59 \item To override the Job specification in a Schedule Run directive in the
62 {\bf SpoolData = yes\vb{}no}
64 \item To override the Job specification in a bconsole session using the \texttt{run}
65 command. Please note that this does {\bf not } refer to a configuration
66 statement, but to an argument for the run command.
68 {\bf SpoolData=yes\vb{}no}
70 \item To limit the the maximum spool file size for a particular job in the Job
73 {\bf Spool Size = size}
74 Where size is a the maximum spool size for this job specified in bytes.
76 \item To limit the maximum total size of the spooled data for a particular
77 device. Specified in the Device resource of the Storage daemon's conf file
80 {\bf Maximum Spool Size = size}
81 Where size is a the maximum spool size for all jobs specified in bytes.
83 \item To limit the maximum total size of the spooled data for a particular
84 device for a single job. Specified in the Device Resource of the Storage
85 daemon's conf file (default unlimited).
87 {\bf Maximum Job Spool Size = size}
88 Where size is the maximum spool file size for a single job specified in
91 \item To specify the spool directory for a particular device. Specified in
92 the Device Resource of the Storage daemon's conf file (default, the working
95 {\bf Spool Directory = directory}
100 % TODO: fix this section name
101 \section{!!! MAJOR WARNING !!!}
102 \index[general]{WARNING! MAJOR }
103 \index[general]{ MAJOR WARNING }
105 Please be very careful to exclude the spool directory from any backup,
106 otherwise, your job will write enormous amounts of data to the Volume, and
107 most probably terminate in error. This is because in attempting to backup the
108 spool file, the backup data will be written a second time to the spool file,
109 and so on ad infinitum.
111 Another advice is to always specify the maximum spool size so that your disk
112 doesn't completely fill up. In principle, data spooling will properly detect a
113 full disk, and despool data allowing the job to continue. However, attribute
114 spooling is not so kind to the user. If the disk on which attributes are being
115 spooled fills, the job will be canceled. In addition, if your working
116 directory is on the same partition as the spool directory, then Bacula jobs
117 will fail possibly in bizarre ways when the spool fills.
120 \section{Other Points}
121 \index[general]{Points!Other }
122 \index[general]{Other Points }
125 \item When data spooling is enabled, Bacula automatically turns on attribute
126 spooling. In other words, it also spools the catalog entries to disk. This is
127 done so that in case the job fails, there will be no catalog entries
128 pointing to non-existent tape backups.
129 \item Attribute despooling occurs near the end of a job. The Storage daemon
130 accumulates file attributes during the backup and sends them to the
131 Director at the end of the job. The Director then inserts the file
132 attributes into the catalog. During this insertion, the tape drive may
133 be inactive. When the file attribute insertion is completed, the job
135 \item Attribute spool files are always placed in the working directory of
137 \item When Bacula begins despooling data spooled to disk, it takes exclusive
138 use of the tape. This has the major advantage that in running multiple
139 simultaneous jobs at the same time, the blocks of several jobs will not be
141 \item It probably does not make a lot of sense to enable data spooling if you
142 are writing to disk files.
143 \item It is probably best to provide as large a spool file as possible to
144 avoid repeatedly spooling/despooling. Also, while a job is despooling to
145 tape, the File daemon must wait (i.e. spooling stops for the job while it is
147 \item If you are running multiple simultaneous jobs, Bacula will continue
148 spooling other jobs while one is despooling to tape, provided there is
149 sufficient spool file space.