diff -ur ../rdiff-backup.orig/rdiff-backup.1 ./rdiff-backup.1 --- rdiff-backup.1.orig Wed Jul 21 11:48:43 2004 +++ rdiff-backup.1 Wed Jul 21 16:54:49 2004 @@ -101,6 +101,15 @@ Exclude all device files. This can be useful for security/permissions reasons or if rdiff-backup is not handling device files correctly. .TP +.B "--exclude-fifo-files" +Exclude all fifo files. +.TP +.B "--exclude-socket-files" +Exclude all socket files. +.TP +.B "--exclude-symbolic-links" +Exclude all symbolic links. +.TP .BI "--exclude-filelist " filename Excludes the files listed in .IR filename . @@ -141,7 +150,7 @@ section for more information. .TP .B --exclude-special-files -Exclude all device files, fifos, sockets, and symlinks. +Exclude all device files, fifo files, socket files, and symbolic links. .TP .B --force Authorize the updating or overwriting of a destination path. @@ -546,7 +555,9 @@ The file selection system comprises a number of file selection conditions, which are set using one of the following command line options: -.BR --exclude , --exclude-device-files , --exclude-filelist , +.BR --exclude , --exclude-filelist , +.BR --exclude-device-files , --exclude-fifo-files , +.BR --exclude-socket-files , --exclude-symbolic-links , .BR --exclude-globbing-filelist , .BR --exclude-filelist-stdin , --exclude-regexp , --exclude-special-files , .BR --include , diff -ur ../rdiff-backup.orig/rdiff_backup/Main.py ./rdiff_backup/Main.py --- rdiff_backup/Main.py.orig Wed Jul 21 11:48:43 2004 +++ rdiff_backup/Main.py Wed Jul 21 17:21:51 2004 @@ -56,6 +56,8 @@ ["backup-mode", "calculate-average", "check-destination-dir", "compare", "compare-at-time=", "current-time=", "exclude=", "exclude-device-files", "exclude-filelist=", + "exclude-symbolic-links", "exclude-socket-files", + "exclude-fifo-files", "exclude-filelist-stdin", "exclude-globbing-filelist=", "exclude-globbing-filelist-stdin", "exclude-mirror=", "exclude-other-filesystems", "exclude-regexp=", @@ -89,6 +91,9 @@ Globals.set_integer('current_time', arg) elif opt == "--exclude": select_opts.append((opt, arg)) elif opt == "--exclude-device-files": select_opts.append((opt, arg)) + elif opt == "--exclude-symbolic-links": select_opts.append((opt, arg)) + elif opt == "--exclude-socket-files": select_opts.append((opt, arg)) + elif opt == "--exclude-fifo-files": select_opts.append((opt, arg)) elif opt == "--exclude-filelist": select_opts.append((opt, arg)) select_files.append(sel_fl(arg)) diff -ur ../rdiff-backup.orig/rdiff_backup/selection.py ./rdiff_backup/selection.py --- rdiff_backup/selection.py.orig Wed Jul 21 11:48:43 2004 +++ rdiff_backup/selection.py Wed Jul 21 17:42:45 2004 @@ -233,6 +233,12 @@ self.add_selection_func(self.glob_get_sf(arg, 0)) elif opt == "--exclude-device-files": self.add_selection_func(self.devfiles_get_sf(0)) + elif opt == "--exclude-symbolic-links": + self.add_selection_func(self.symlinks_get_sf(0)) + elif opt == "--exclude-socket-files": + self.add_selection_func(self.sockets_get_sf(0)) + elif opt == "--exclude-fifo-files": + self.add_selection_func(self.fifos_get_sf(0)) elif opt == "--exclude-filelist": self.add_selection_func(self.filelist_get_sf( filelists[filelists_index], 0, arg)) @@ -457,8 +463,12 @@ def devfiles_get_sf(self, include): """Return a selection function matching all dev files""" if self.selection_functions: - log.Log("Warning: exclude-device-files is not the first " - "selector.\nThis may not be what you intended", 3) + for sf in self.selection_functions: + if not sf.exclude: + log.Log( +"""Warning: %s selector was specified + before the exclude-device-files selector. + This may not be what you intended.""" % (sf.name), 3) def sel_func(rp): if rp.isdev(): return include else: return None @@ -466,11 +476,63 @@ sel_func.name = (include and "include" or "exclude") + " device files" return sel_func + def symlinks_get_sf(self, include): + """Return a selection function matching all symlinks""" + if self.selection_functions: + for sf in self.selection_functions: + if not sf.exclude: + log.Log( +"""Warning: %s selector was specified + before the exclude-symbolic-links selector. + This may not be what you intended.""" % (sf.name), 3) + def sel_func(rp): + if rp.issym(): return include + else: return None + sel_func.exclude = not include + sel_func.name = (include and "include" or "exclude") + " symbolic links" + return sel_func + + def sockets_get_sf(self, include): + """Return a selection function matching all sockets""" + if self.selection_functions: + for sf in self.selection_functions: + if not sf.exclude: + log.Log( +"""Warning: %s selector was specified + before the exclude-socket-files selector. + This may not be what you intended.""" % (sf.name), 3) + def sel_func(rp): + if rp.issock(): return include + else: return None + sel_func.exclude = not include + sel_func.name = (include and "include" or "exclude") + " socket files" + return sel_func + + def fifos_get_sf(self, include): + """Return a selection function matching all fifos""" + if self.selection_functions: + for sf in self.selection_functions: + if not sf.exclude: + log.Log( +"""Warning: %s selector was specified + before the exclude-fifo-files selector. + This may not be what you intended.""" % (sf.name), 3) + def sel_func(rp): + if rp.isfifo(): return include + else: return None + sel_func.exclude = not include + sel_func.name = (include and "include" or "exclude") + " fifo files" + return sel_func + def special_get_sf(self, include): """Return sel function matching sockets, symlinks, sockets, devs""" if self.selection_functions: - log.Log("Warning: exclude-special-files is not the first " - "selector.\nThis may not be what you intended", 3) + for sf in self.selection_functions: + if not sf.exclude: + log.Log( +"""Warning: %s selector was specified + before the exclude-special-files selector. + This may not be what you intended.""" % (sf.name), 3) def sel_func(rp): if rp.issym() or rp.issock() or rp.isfifo() or rp.isdev(): return include