zahniser.net :: software

— etc —

 

— HyperList —

Hierarchical to-do lists

— hsiloP —

Calculator program

— Hexie —

Hex editor

— Mirth —

Read daily comics

— Strange —

Chaotic attractors

 

 

 

contact email:

michael at zahniser dot net

etc :: thumbsync

Download: thumbsync.cpp (should compile on any platform with fts).

Like many of you, I carry my life around on a thumb drive. This is a simple command-line program for keeping two folders synchronized with each other. I use it to keep my thumb drive synchronized with a folder on my hard drive, so that if either one dies or is lost or stolen, I'll still have all my data.

If a file exists in both locations, the "last modified" dates on the files are compared and the newer file is copied. If a file only esists in one location, it is copied to the other (NOTE: this makes deleting a file a bit more complicated, because you must manually delete it from both locations).

By default, thumbsync runs in interactive mode: it prints the exact text of all the copy commands that it is going to execute and asks you whether or not to continue. I highly recommend running in this mode, especially around the daylight-savings-time switch, when the file timestamp comparison may get messed up.

thumbsync refrains from copying any file starting with a period, and also does not copy directories likely to contain build products. Since I run it on the Mac, that means skipping directories named "build". You can modify what directories are skipped by editing the ReadDirectory() function.

Type "$man fts" in the shell to find out whether your system has the file system libraries used by thumbsync. Mac OS X does, and I believe most brands of Linux do as well. If you don't have a shell, you probably don't have fts either.