1 diff -Naur bacula1/src/dird/inc_conf.c bacula2/src/dird/inc_conf.c
2 --- bacula1/src/dird/inc_conf.c 2007-02-19 20:44:13.000000000 +0100
3 +++ bacula2/src/dird/inc_conf.c 2007-02-19 20:44:33.000000000 +0100
5 {"noatime", store_opts, {0}, 0, 0, 0},
6 {"enhancedwild", store_opts, {0}, 0, 0, 0},
7 {"drivetype", store_drivetype, {0}, 0, 0, 0},
8 + {"checkchanges", store_opts, {0}, 0, 0, 0},
9 {NULL, NULL, {0}, 0, 0, 0}
17 + INC_KW_ENHANCEDWILD,
23 {"hfsplussupport", INC_KW_HFSPLUS},
24 {"noatime", INC_KW_NOATIME},
25 {"enhancedwild", INC_KW_ENHANCEDWILD},
26 + {"checkchanges", INC_KW_CHKCHANGES},
31 {"no", INC_KW_NOATIME, "0"},
32 {"yes", INC_KW_ENHANCEDWILD, "K"},
33 {"no", INC_KW_ENHANCEDWILD, "0"},
34 + {"yes", INC_KW_CHKCHANGES, "c"},
35 + {"no", INC_KW_CHKCHANGES, "0"},
39 diff -Naur bacula1/src/filed/backup.c bacula2/src/filed/backup.c
40 --- bacula1/src/filed/backup.c 2007-02-19 20:44:13.000000000 +0100
41 +++ bacula2/src/filed/backup.c 2007-02-19 20:47:14.000000000 +0100
45 stat = send_data(jcr, data_stream, ff_pkt, digest, signing_digest);
47 + if (ff_pkt->flags & FO_CHKCHANGES) {
48 + file_have_changed(jcr, ff_pkt);
56 diff -Naur bacula1/src/filed/job.c bacula2/src/filed/job.c
57 --- bacula1/src/filed/job.c 2007-02-19 20:44:13.000000000 +0100
58 +++ bacula2/src/filed/job.c 2007-02-19 20:44:33.000000000 +0100
61 fo->flags |= FO_NOATIME;
64 + fo->flags |= FO_CHKCHANGES;
67 Emsg1(M_ERROR, 0, _("Unknown include/exclude option: %c\n"), *p);
69 diff -Naur bacula1/src/findlib/find.h bacula2/src/findlib/find.h
70 --- bacula1/src/findlib/find.h 2007-02-19 20:44:16.000000000 +0100
71 +++ bacula2/src/findlib/find.h 2007-02-19 20:44:33.000000000 +0100
73 #define FO_ENCRYPT (1<<21) /* Encrypt data stream */
74 #define FO_NOATIME (1<<22) /* Use O_NOATIME to prevent atime change */
75 #define FO_ENHANCEDWILD (1<<23) /* Enhanced wild card processing */
76 +#define FO_CHKCHANGES (1<<24) /* Check if file have been modified during backup */
78 struct s_included_file {
79 struct s_included_file *next;
80 diff -Naur bacula1/src/findlib/find_one.c bacula2/src/findlib/find_one.c
81 --- bacula1/src/findlib/find_one.c 2007-02-19 20:44:16.000000000 +0100
82 +++ bacula2/src/findlib/find_one.c 2007-02-19 20:44:33.000000000 +0100
87 +/* check if a file have changed during backup and display an error */
88 +bool file_have_changed(JCR *jcr, FF_PKT *ff_pkt)
91 + Dmsg1(500, "file_have_changed fname=%s\n",ff_pkt->fname);
93 + if (ff_pkt->type != FT_REG) { /* not a regular file */
97 + if (lstat(ff_pkt->fname, &statp) != 0) {
99 + Jmsg(jcr, M_WARNING, 0,
100 + _("Can't check if %s have changed ERR=%s.\n"),ff_pkt->fname,be.strerror());
104 + if (statp.st_mtime != ff_pkt->statp.st_mtime) {
105 + /* TODO: add time of changes */
106 + Jmsg(jcr, M_ERROR, 0, _("%s have changed during backup.\n"), ff_pkt->fname);
110 + if (statp.st_ctime != ff_pkt->statp.st_ctime) {
111 + /* TODO: add time of changes */
112 + Jmsg(jcr, M_ERROR, 0, _("%s have changed during backup.\n"), ff_pkt->fname);
116 + if (statp.st_size != ff_pkt->statp.st_size) {
117 + /* TODO: add size change */
118 + Jmsg(jcr, M_ERROR, 0, _("%s size have changed during backup.\n"),ff_pkt->fname);
122 + if ((statp.st_blksize*statp.st_blocks) !=
123 + (ff_pkt->statp.st_blksize*ff_pkt->statp.st_blocks)) {
124 + /* TODO: add size change */
125 + Jmsg(jcr, M_ERROR, 0, _("%s size have changed during backup.\n"),ff_pkt->fname);
133 * Find a single file.
134 * handle_file is the callback for handling the file.
135 diff -Naur bacula1/src/findlib/protos.h bacula2/src/findlib/protos.h
136 --- bacula1/src/findlib/protos.h 2007-02-19 20:44:16.000000000 +0100
137 +++ bacula2/src/findlib/protos.h 2007-02-19 20:44:33.000000000 +0100
139 int handle_file(FF_PKT *ff_pkt, void *hpkt, bool top_level),
140 void *pkt, char *p, dev_t parent_device, bool top_level);
141 int term_find_one(FF_PKT *ff);
143 +bool file_have_changed(JCR *jcr, FF_PKT *ff_pkt);
145 /* From get_priv.c */
146 int enable_backup_privileges(JCR *jcr, int ignore_errors);