NativeWindowsPort
From RdiffBackupWiki
From release 1.2.0 there is a native win32 binary on the download page that doesn't require cygwin or python to run. However if a remote host should be used some additional steps must be completed found in BackupFromWindowsToLinux.
Why not to use Cygwin-based Python/rdiff-backup -- is does not work now, and due to many translation layers, it is hard to make it work.
Initial research shows that currently rdiff-backup is VERY Unix-biased.
Native implementation will require following modifications:
- Rewrite C.make_file_dict to extract stat, inode, hardlinks etc in Windows sensible manner. Unfortunately, Python substitute nonsensical or "safe" values for most of such fields of stat structure. A feasible approach is to copy appropriate code from Cygwin - they did a great job.
- Rewrite user_group.py - it now uses Unix-specific Python modules - grp and pwd. Cygwin again can be an inspiration how to handle it.
- Some refactoring of module Globals -- rdiff-backup uses process_uid and process_gid from Globals in fixed patterns (not completely apparent to me -- I am not a Unix professional -- but possibly checking do we run as root and so should we try to chown). It can be replaced by somewhat less platform-dependent, say a way to try to chown.
- All platform-specific stuff better be encapsulated in modules, instead of *_active, *_write *_conn stuff.
- Storage format should be better documented - it is impossible to figure out from documentation how to store e.g. Mac's resource fork, and NTFS file can have as many "streams" beyond the main one as you wish.
Sidenote: why datetime is stored in zone format, not UTC? It complicates logic (though date comparison can be contained in module) and does not add any useful info. And colon is reserved (twice - drive separator, and stream separator) in Windows, so can we store datetime separated with something more neutral, say underscore -- this could be useful if you'd try to copy over your backup directory from Unix to Windows.
- Comment by BenEscoto: I don't think we should break backwards compatibility by messing with the names of the increments now. The original idea was that it would be easier for linux/unix types to see what times the increments were if they were in local time (back then there was no --list-increments switch). Also the current format used is a proposed w3 standard.
What do you think?
From DaveKempe: I am very interested in a native win32 -> linux solution. I didn't have the time/money to make it work, and so got the cygwin one working... let me know if you need support for this to work - I am very interested.
P.S. As a first step, I built librsync as a static library and built _librsync.pyd with it.
In case anybody insterested - I make native Windows backup to do real local backup - it can even can compare - but not to do second backup and definitely, not restore. But I think in couple days I will get it working, though w/o rights, ACLs, NTFS streams.
