[wplug] OT - synchronizing files with memory stick
Aaron Silinskas
aaron at mindwidgets.com
Sat Jan 7 21:31:46 EST 2006
I'm wondering if a file-based cvs/svn setup would work better for you.
The main issues that come to mind are:
- you'd have to run a sync command before removing the card to commit
any new changes/files/deletions to the memory card
- there may be issues if the same file-based repository is accessed from
linux/bsd/windows, this is purely a guess though
Your hotplug script could run an update and commit, and if you wanted to
get fancy you could have a section handle merge/conflicts by moving one
of the conflicting files to a separate "conflicts" area. I don't use
memory cards, or I'd give this a shot and let you know.
I'm more of a fan of syncing via a hosting service since $10/month
can usually get a few gigs of net-space. GMail is another option for
file syncing, not sure if a windows-based file explorer interface exists
for GMail though. I have messed with mounting a GMail account to a
directory in linux and that worked fine.
Hope some of this is useful,
Aaron
Brandon Kuczenski wrote:
> I am writing a hotplug script to synchronize some directories on my
> local machine with directories on a flash memory stick every time it is
> plugged in, using rsync. The synchronization is two-directional,
> meaning first it updates local files to match newer files on the memory
> stick, and then it updates the stick to match newer files on the local
> machine. The idea is that I can use this script on multiple computers
> and always have the same set of documents to work with.
>
> There are a few challenges. For one, the memory stick uses vfat (which
> is desirable so I can use the stick on windows computers if necessary)
> which does not support preserving timestamps when copying data --
> utime(2) doesn't work. To work around this, I tell rsync to compare
> files by checksum rather than by modification time, since files copied
> to the stick will always look as old as the time they're copied, rather
> than the time they were created.
>
> Second, and more interesting from an algorithmic perspective, it becomes
> impossible to delete files: if I remove the files on one computer, then
> as soon as I plug the stick into another computer the old file will be
> regenerated. I was wondering if anyone could think of a sensible way a
> scheme like this 'should' work that would allow useless files to be
> removed without manually deleting them from every computer on which
> they're present.
>
> My scripts are currently available on the web at
> http://301south.net/works/bkp-stick if anyone wants to have a look.
> Works in progress, remember.
>
> -Brandon
>
> _______________________________________________
> wplug mailing list
> wplug at wplug.org
> http://www.wplug.org/mailman/listinfo/wplug
More information about the wplug
mailing list