From owner-freebsd-questions@freebsd.org Wed Apr 13 10:30:46 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AECD9B0EC4D for ; Wed, 13 Apr 2016 10:30:46 +0000 (UTC) (envelope-from benfell@parts-unknown.org) Received: from mail.parts-unknown.org (n4rky-1-pt.tunnel.tserv29.fmt1.ipv6.he.net [IPv6:2001:470:66:119::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95E5C183D for ; Wed, 13 Apr 2016 10:30:46 +0000 (UTC) (envelope-from benfell@parts-unknown.org) Received: from [192.168.1.75] (unknown [50.250.218.173]) by mail.parts-unknown.org (Postfix) with ESMTPSA id E67B35979242 for ; Wed, 13 Apr 2016 03:30:45 -0700 (PDT) Subject: Re: SOLVED, BUT UGLY, was Re: rsync update mixed environment To: freebsd-questions@freebsd.org References: <570C9DE3.6030601@parts-unknown.org> <570CA890.7090706@FreeBSD.org> <570D9B74.80005@parts-unknown.org> <570DF3AC.1030501@FreeBSD.org> From: David Benfell Message-ID: <570E1FD0.8080309@parts-unknown.org> Date: Wed, 13 Apr 2016 03:30:40 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <570DF3AC.1030501@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="MieLSOweLMhivGal8qm9P9gQuwrJnhl0W" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2016 10:30:46 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MieLSOweLMhivGal8qm9P9gQuwrJnhl0W Content-Type: multipart/mixed; boundary="cTwRfNIajtDbDua2f2BTXUbUWCr363LPA" From: David Benfell To: freebsd-questions@freebsd.org Message-ID: <570E1FD0.8080309@parts-unknown.org> Subject: Re: SOLVED, BUT UGLY, was Re: rsync update mixed environment References: <570C9DE3.6030601@parts-unknown.org> <570CA890.7090706@FreeBSD.org> <570D9B74.80005@parts-unknown.org> <570DF3AC.1030501@FreeBSD.org> In-Reply-To: <570DF3AC.1030501@FreeBSD.org> --cTwRfNIajtDbDua2f2BTXUbUWCr363LPA Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/13/2016 12:22 AM, Matthew Seaman wrote: > So, rsync works fine if called directly from the command line, but fail= s > in your script? Yup. > That sounds as if you're modifying something in the > environment which is in turn causing problems for rsync(8). The good > news is that there are only 8 variables documented as affecting rsync -= - > see the section 'ENVIRONMENT VARIABLES' towards the end of rsync(1). I looked all these up, added the ones you suggested, and had my script print them out. Nothing unexpected, except perhaps IFS, which mostly means I haven't taken the trouble to even figure out if I want to do something with them. These are on the Linux system (and if it helps, Sabayon is a Gentoo derivative): CVSIGNORE=3D RSYNC_ICONV=3D RSYNC_PROTECT_ARGS=3D RSYNC_RSH=3D RSYNC_PROXY=3D RSYNC_PASSWORD=3D USER=3Dbenfell LOGNAME=3Dbenfell HOME=3D/home/benfell PATH=3D/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/= bin:/opt/Citrix/ICAClient:/opt/freerapid:/opt/blackdown-jdk-1.4.2.03/bin:= /opt/blackdown-jdk-1.4.2.03/jre/bin:/opt/dmd/bin:/usr/lib/plan9/bin:/usr/= libexec/gpc/x86_64-p c-linux-gnu/3.4:/opt/nvidia-cg-toolkit/bin:/opt/tivoli/tsm/client/ba/bin:= /opt/eagle/bin:/opt/vmware/bin:/opt/aws-as-tools/bin:/opt/aws-cw-tools/bi= n:/opt/aws-elb-tools/bin:/opt/aws-iam-tools/bin:/opt/aws-rds-tools/bin:/u= sr/bin/cdsclient:/opt/cuda/bin:/opt/ekopath/bin:/usr/ti-linux-gnu/tigcc-b= in/4.1.2:/usr/ti-linux-gnu/bin IFS=3D =20 ^@ Having to cook up your own mechanism to extract file modification times is only good in the sense that it enables you to get your job done. That's what rsync(8) really should be doing -- and the C language interface using stat(2) is a lot more standardized than the stat(1) wrapper program. Yeah, hence the weird script that I adapted from stackoverflow. > > Cheers, > > Matthew > > --=20 David Benfell, Ph.D. benfell@parts-unknown.org --cTwRfNIajtDbDua2f2BTXUbUWCr363LPA-- --MieLSOweLMhivGal8qm9P9gQuwrJnhl0W Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJXDh/VAAoJEOoml8Ul4D7WiaoP/05d+n73tEeIx9ro0eakd4PR KNdKCgQWDKA62UnclYGs8mZW0t/U4xEq0L7BztMuFfKsUY/9kUYTldXx+COMUUC/ IKiVJAAWoQPQcLpSn9XQGB4IbvQIvpt07sOU6vZIE3TEG2BPmAOnyBNaAJhr61hA 9pIMoAtJCqtnvKh4MdiFNc23RQ4uDU4V9DuOlmrS88e4A3EkfvT/WXyYY3S4nFR5 htidzjix6+BmD6QXv7W7X9eW5YNky/3k69XMSFjUTRAccSS/rWZu8vQ0mJpDwBhf HKQFwk/HGvXcQ9nivTx/w4yzMl5ihYgjKPRxYXoyz8ea8lv3vhmQtCc+jVFoe1e5 0+3OZuLkmUtz8RYakMKbKT5gjDky2z+0S8H5nsabBm+YTpbGzUJrePZ+7EeeuMKd jHX7XPgnB0o3BG3XDUSc+EPJs7CiuaLnN5N3Fl0lRw7b+H2h2riJPTIfj48jJR6Z xsjWDjqPxIbiL+WZysjMKsV8U13APBTyrhJZageXHWADQMGZlU9Tyle8rCJsVA/2 0KJVm1itZveALDk6t6MDU7ljmTKXotaJdJn1aFT4wXCAocS7phiHrydd9KxA5Q8N 5O8R5p3gsuH7kwzraM5tyFGSJzOcKnTo/bRwsVe0s7JVBEbhI8dotaG3zkencrJ5 N32XJHQLCeoKVtn6BopY =XYU1 -----END PGP SIGNATURE----- --MieLSOweLMhivGal8qm9P9gQuwrJnhl0W--