Search code examples
windowssynchronizationbackuplibrariesd

Basic Software-Design Questions about backup-prog. in D


For some Webhost issues I have to write a file backup/syncronisation tool for a common OS in the server sector (Windows/Linux). Most Linux root-servers offers the ssh-interface for secure communication so I could use the SSH File Transfer Protocol, but what's the best solution on the windows side (on the fly) ? And are there good D libraries (or C alternatives)

I'm writing here and not in the admin or windows stack because there is one reason: It's important that there are existing libraries. So an easy implementation is more important than the existence of an interface or protocol. The simplicity and the language features and not the possibilities have priority.

All in all I am looking for an easy way to implement an os independent tool for a file exchange. For the synchronisation work it has to be possible to access some file information ( last write time, modified time, filesize, etc.)

edit:"My Version" of a synconisation tool should work on a new system without extra sotfware installation (maybe some automated installation over ssh-windows-equivalent [if there is one]) You only enter your access data and it should work. Furthermore I also need a protocol and this is the biggest problem. Because ssh doesn't work on windows on the fly - is there an equivalent?


Solution

  • rsync is a popular file synchronization tool, best suited to files being added, deleted, or extended. It's been very well debugged and is quite simple to set up. (rsync -avzP username@hostname:/path/to/source/ /path/to/dest/ or rsync -avzP /path/to/source/ username@hostname:/path/to/dest/ are common.)

    rsync is frequently tunneled over ssh; it does have its own protocol if you don't mind it being publicly open.

    But if you've got a lot of data that is being slightly moved, or frequent renames, a tool like git can make much better use of bandwidth. It does carry the downside of keeping history on both sides, which might be less disk-efficient than you'd like, but it can more than compensate if your bandwidth is a bit less amazing.

    git is also frequently tunneled over ssh; it also has its own protocol if you don't mind it being publicly open.

    I doubt either one has D library bindings, but C bindings ought to be easy to come by. :)