Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jun 2014 16:22:38 -0600 (MDT)
From:      Dale Scott <dalescott@shaw.ca>
To:        freebsd-questions@freebsd.org
Subject:   samba, rsync --backup, and mangled instead of long filenames
Message-ID:  <489659738.13024627.1403216558777.JavaMail.root@cds005>
In-Reply-To: <360406130.12989549.1403213723396.JavaMail.root@cds005>

next in thread | previous in thread | raw e-mail | index | archive | help
I've got backup files created by rsync in a Samba file share being served with mangled filenames to a Windows client. I suspect it's because I'm telling rsync to create backup filenames with colons in them and, since Windows doesn't allow colons in a filename, Samba has no choice but to serve mangled filenames. Does that make sense? Are there any _easy_ solutions?

Background - I'm using rsync and cron to nightly synchronize a local directory on an fbsd server with a Windows server share containing AutoCAD dwg files (among others). I'm using the rsync "--backup" option to preserve historical copies of files because the Windows users can arbitrarily modify files in their share (e.g. by updating a drawing from rev 1 to rev 2, overwriting the v1 file). Even if I could convince users to append the version to the filename, it could never be guaranteed.

My rsync command line:

rsync -aq --itemize-changes --include-from=rsync_mech_include --exclude-from=rsync_mech_exclude --backup --suffix=-`date +%FT%T` --log-file="/tmp/rsync.log" "/mnt/share/AutoCAD/16000-16999/"  /home/samba/mech/parts.rsync/10016000

If e.g. file 10016342.dwg is created in the Windows share, copied by rsync to the local fbsd directory, then modified in the Windows server share, rsync renames the local 10016342.dwg to something like 10016342.dwg-2014-06-10T18:15:19 first, then copies the updated file.

Ideally, I'd rather have backup filenames like 10016342-2014-06-10-T-18-15-19.dwg so they sort nicer and, because the extension is preserved, can be opened (read-only) from a Windows client. However, that's out of scope for --suffix. I could append ".dwg" in the suffix, but I have to deal with essentially arbitrary file extensions, and disassembling and reassembling file names on the fly simply seems like a bad idea, especially if a more out-of-box solution exists.

Any suggestions?

Dale
----
Transparency with Trust



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?489659738.13024627.1403216558777.JavaMail.root>