From owner-freebsd-questions@FreeBSD.ORG Thu Jun 19 22:23:51 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 267121D8 for ; Thu, 19 Jun 2014 22:23:51 +0000 (UTC) Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by mx1.freebsd.org (Postfix) with ESMTP id ED313217A for ; Thu, 19 Jun 2014 22:23:50 +0000 (UTC) Received: from pd2mr2so-ssvc.prod.shaw.ca ([10.0.141.109]) by pd2mo1so-svcs.prod.shaw.ca with ESMTP; 19 Jun 2014 16:22:42 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=rlpOHkmR3aalKarM4GIWLuzCr1F3/0x4+1dImnr+a3g= c=1 sm=1 a=FKkrIqjQGGEA:10 a=6NQ2G-hUxLYA:10 a=HymfytWnGS0A:10 a=BLceEmwcHowA:10 a=IkcTkHD0fZMA:10 a=PAI6pFh5_FM2H1OoTo0A:9 a=QEXdDO2ut3YA:10 a=bnxKFDBwCGMR4PsM:21 a=bw76LyT2LnWgl22z:21 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO cds005.dcs.int.inet) ([10.0.141.22]) by pd2mr2so-svcs.prod.shaw.ca with ESMTP; 19 Jun 2014 16:22:38 -0600 Date: Thu, 19 Jun 2014 16:22:38 -0600 (MDT) From: Dale Scott To: freebsd-questions@freebsd.org Message-ID: <489659738.13024627.1403216558777.JavaMail.root@cds005> In-Reply-To: <360406130.12989549.1403213723396.JavaMail.root@cds005> Subject: samba, rsync --backup, and mangled instead of long filenames MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [147.108.253.253] X-Mailer: Zimbra 7.1.4_GA_2567 (ZimbraWebClient - GC35 (Win)/7.1.4_GA_2555) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jun 2014 22:23:51 -0000 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