]> git.sur5r.net Git - bacula/docs/blob - docs/manuals/en/main/basejob.tex
Fix prior bad patch and reference to undefined variable
[bacula/docs] / docs / manuals / en / main / basejob.tex
1 \chapter{File Deduplication using Base Jobs}
2 \index[general]{Base Jobs}
3 \index[general]{File Deduplication}
4 \label{basejobs}
5 A base job is sort of like a Full save except that you will want the FileSet to
6 contain only files that are unlikely to change in the future (i.e.  a snapshot
7 of most of your system after installing it).  After the base job has been run,
8 when you are doing a Full save, you specify one or more Base jobs to be used.
9 All files that have been backed up in the Base job/jobs but not modified will
10 then be excluded from the backup.  During a restore, the Base jobs will be
11 automatically pulled in where necessary.
12
13 This is something none of the competition does, as far as we know (except
14 perhaps BackupPC, which is a Perl program that saves to disk only).  It is big
15 win for the user, it makes Bacula stand out as offering a unique optimization
16 that immediately saves time and money.  Basically, imagine that you have 100
17 nearly identical Windows or Linux machine containing the OS and user files.
18 Now for the OS part, a Base job will be backed up once, and rather than making
19 100 copies of the OS, there will be only one.  If one or more of the systems
20 have some files updated, no problem, they will be automatically restored.
21
22 A new Job directive \texttt{Base=Jobx, Joby...} permits to specify the list of
23 files that will be used during Full backup as base.
24
25 \begin{verbatim}
26 Job {
27    Name = BackupLinux
28    Level= Base
29    ...
30 }
31
32 Job {
33    Name = BackupZog4
34    Base = BackupZog4, BackupLinux
35    Accurate = yes
36    ...
37 }
38 \end{verbatim}
39
40 In this example, the job \texttt{BackupZog4} will use the most recent version
41 of all files contained in \texttt{BackupZog4} and \texttt{BackupLinux}
42 jobs. Base jobs should have run with \texttt{level=Base} to be used.
43
44 By default, Bacula will compare permissions bits, user and group fields,
45 modification time, size and the checksum of the file to choose between the
46 current backup and the BaseJob file list. You can change this behavior with the
47 \texttt{BaseJob} FileSet option. This option works like the \texttt{verify=}
48 one, that is described in the \ilink{FileSet}{FileSetResource} chapter.
49
50 \begin{verbatim}
51 FileSet {
52   Name = Full
53   Include = {
54     Options {
55        BaseJob  = pmugcs5
56        Accurate = mcs
57        Verify   = pin5
58     }
59     File = /
60   }
61 }
62 \end{verbatim}
63
64 \textbf{Important note}: The current implementation doesn't permit to scan
65 volume with \textbf{bscan}. The result wouldn't permit to restore files
66 easily. It is recommended to not prune File or Job records with Basejobs.
67
68 \smallskip
69
70 Added in version 8.0.5, the new ``M'' option letter for the Accurate directive
71 in the FileSet Options block, which allows comparing the modification time and/or
72 creation time against the last backup timestamp. This is in contrast to the
73 existing options letters ``m'' and/or ``c'', mtime and ctime, which are checked
74 against the stored catalog values, that could vary accross different machines
75 when using the BaseJob feature.
76
77 The advantage of the new ``M'' option letter for Jobs that refer to BaseJobs is
78 that it will backup files based on the last backup time, which is more useful,
79 because the mtime/ctime timestamps may differ on various Clients, causing
80 unnecessary files to be backed up.
81
82 \begin{verbatim}
83   Job {
84     Name = USR
85     Level = Base
86     FileSet = BaseFS
87     ...
88   }
89
90   Job {
91     Name = Full
92     FileSet = FullFS
93     Base = USR
94     ...
95   }
96
97   FileSet {
98     Name = BaseFS
99     Include {
100       Options {
101         Signature = MD5
102       }
103       File = /usr
104     }
105   }
106
107   FileSet {
108     Name = FullFS
109     Include {
110       Options {
111         Accurate = Ms      # check for mtime/ctime and Size
112         Signature = MD5
113       }
114       File = /home
115       File = /usr
116     }
117   }
118 \end{verbatim}