summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-12-22 16:57:41 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-12-22 16:57:41 +0000
commit53b282f4333293ed897f81cddc77c4b5d873a285 (patch)
treedb2bdadefc4e7b46530a8fb44982aa20069306d0
parente601a12bfe58ac74f2e510f063e7ee93f5e9359e (diff)
downloadrdiff-backup-53b282f4333293ed897f81cddc77c4b5d873a285.tar.gz
Prevent backing-up reparse points on Windows
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@977 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/rdiff-backup.15
-rw-r--r--rdiff-backup/rdiff_backup/Main.py3
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py10
3 files changed, 16 insertions, 2 deletions
diff --git a/rdiff-backup/rdiff-backup.1 b/rdiff-backup/rdiff-backup.1
index 8e9dc2f..780c4d7 100644
--- a/rdiff-backup/rdiff-backup.1
+++ b/rdiff-backup/rdiff-backup.1
@@ -1,4 +1,4 @@
-.TH RDIFF-BACKUP 1 "JULY 2007" "Version 1.1.13" "User Manuals" \" -*- nroff -*-
+.TH RDIFF-BACKUP 1 "DECEMBER 2008" "Version 1.2.3" "User Manuals" \" -*- nroff -*-
.SH NAME
rdiff-backup \- local/remote mirror and incremental backup
.SH SYNOPSIS
@@ -188,7 +188,8 @@ Exclude all device files, fifo files, socket files, and symbolic links.
Exclude all socket files.
.TP
.B "\-\-exclude-symbolic-links"
-Exclude all symbolic links.
+Exclude all symbolic links. This option is automatically enabled if the backup
+source is running on native Windows to avoid backing-up NTFS reparse points.
.TP
.BI "\-\-exclude-if-present " filename
Exclude directories if
diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py
index e6adec1..2576933 100644
--- a/rdiff-backup/rdiff_backup/Main.py
+++ b/rdiff-backup/rdiff_backup/Main.py
@@ -356,6 +356,9 @@ def backup_quoted_rpaths(rpout):
def backup_set_select(rpin):
"""Create Select objects on source connection"""
+ if rpin.conn.os.name == 'nt':
+ log.Log("Symbolic links excluded by default on Windows", 4)
+ select_opts.append(("--exclude-symbolic-links", None))
rpin.conn.backup.SourceStruct.set_source_select(rpin, select_opts,
*select_files)
diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py
index 3655084..9bcdd2e 100644
--- a/rdiff-backup/rdiff_backup/rpath.py
+++ b/rdiff-backup/rdiff_backup/rpath.py
@@ -38,6 +38,10 @@ are dealing with are local or remote.
import os, stat, re, sys, shutil, gzip, socket, time, errno
import Globals, Time, static, log, user_group, C
+try:
+ import win32file, winnt
+except ImportError:
+ pass
class SkipFileException(Exception):
"""Signal that the current file should be skipped but then continue
@@ -328,6 +332,12 @@ def make_file_dict_python(filename):
data['devloc'] = statblock[stat.ST_DEV]
data['nlink'] = statblock[stat.ST_NLINK]
+ if os.name == 'nt':
+ attribs = win32file.GetFileAttributes(filename)
+ if attribs & winnt.FILE_ATTRIBUTE_REPARSE_POINT:
+ data['type'] = 'sym'
+ data['linkname'] = None
+
if not (type == 'sym' or type == 'dev'):
# mtimes on symlinks and dev files don't work consistently
data['mtime'] = long(statblock[stat.ST_MTIME])