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|no}
59 \item To override the Job specification in a Schedule Run directive in the
62 {\bf SpoolData = yes|no}
64 \item To limit the maximum total size of the spooled data for a particular
65 device. Specified in the Device resource of the Storage daemon's conf file
68 {\bf Maximum Spool Size = size}
69 Where size is a the maximum spool size for all jobs specified in bytes.
71 \item To limit the maximum total size of the spooled data for a particular
72 device for a single job. Specified in the Device Resource of the Storage
73 daemon's conf file (default unlimited).
75 {\bf Maximum Job Spool Size = size}
76 Where size is the maximum spool file size for a single job specified in
79 \item To specify the spool directory for a particular device. Specified in
80 the Device Resource of the Storage daemon's conf file (default, the working
83 {\bf Spool Directory = directory}
88 % TODO: fix this section name
89 \section{!!! MAJOR WARNING !!!}
90 \index[general]{WARNING! MAJOR }
91 \index[general]{ MAJOR WARNING }
93 Please be very careful to exclude the spool directory from any backup,
94 otherwise, your job will write enormous amounts of data to the Volume, and
95 most probably terminate in error. This is because in attempting to backup the
96 spool file, the backup data will be written a second time to the spool file,
97 and so on ad infinitum.
99 Another advice is to always specify the maximum spool size so that your disk
100 doesn't completely fill up. In principle, data spooling will properly detect a
101 full disk, and despool data allowing the job to continue. However, attribute
102 spooling is not so kind to the user. If the disk on which attributes are being
103 spooled fills, the job will be canceled. In addition, if your working
104 directory is on the same partition as the spool directory, then Bacula jobs
105 will fail possibly in bizarre ways when the spool fills.
108 \section{Other Points}
109 \index[general]{Points!Other }
110 \index[general]{Other Points }
113 \item When data spooling is enabled, Bacula automatically turns on attribute
114 spooling. In other words, it also spools the catalog entries to disk. This is
115 done so that in case the job fails, there will be no catalog entries
116 pointing to non-existent tape backups.
117 \item Attribute despooling occurs near the end of a job. The Storage daemon
118 accumulates file attributes during the backup and sends them to the
119 Director at the end of the job. The Director then inserts the file
120 attributes into the catalog. During this insertion, the tape drive may
121 be inactive. When the file attribute insertion is completed, the job
123 \item Attribute spool files are always placed in the working directory of
125 \item When Bacula begins despooling data spooled to disk, it takes exclusive
126 use of the tape. This has the major advantage that in running multiple
127 simultaneous jobs at the same time, the blocks of several jobs will not be
129 \item It probably does not make a lot of sense to enable data spooling if you
130 are writing to disk files.
131 \item It is probably best to provide as large a spool file as possible to
132 avoid repeatedly spooling/despooling. Also, while a job is despooling to
133 tape, the File daemon must wait (i.e. spooling stops for the job while it is
135 \item If you are running multiple simultaneous jobs, Bacula will continue
136 spooling other jobs while one is despooling to tape, provided there is
137 sufficient spool file space.