Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Apr 2016 08:22:20 +0100
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: SOLVED, BUT UGLY, was Re: rsync update mixed environment
Message-ID:  <570DF3AC.1030501@FreeBSD.org>
In-Reply-To: <570D9B74.80005@parts-unknown.org>
References:  <570C9DE3.6030601@parts-unknown.org> <570CA890.7090706@FreeBSD.org> <570D9B74.80005@parts-unknown.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--1xRhfpwOcHpvM6cupwUV8NMW9EkXG57qE
Content-Type: multipart/mixed; boundary="u9QG9gUFWepNkuQQE0W85sajKMls0EuVX"
From: Matthew Seaman <matthew@FreeBSD.org>
To: freebsd-questions@freebsd.org
Message-ID: <570DF3AC.1030501@FreeBSD.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>
In-Reply-To: <570D9B74.80005@parts-unknown.org>

--u9QG9gUFWepNkuQQE0W85sajKMls0EuVX
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 13/04/2016 02:05, David Benfell wrote:
> Basically, I couldn't get rsync to update from within a script. No idea=

> why but it looks like some way, somehow the script was the problem.
> Realizing it would be completely unreasonable to expect people on this
> list to debug my fairly gnarly script, I gave up and am using a new
> script to find the local and (with ssh) remote modification times. In
> the script that wasn't working, I'm using this new script to obtain
> those times, compare them, and scp accordingly. This works like a charm=
=2E
>=20
> Yes, I'm wondering why I can go to all that trouble, get it working, an=
d
> utterly fail to get rsync working.

So, rsync works fine if called directly from the command line, but fails
in your script?  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).  Of
those, RSYNC_RSH, HOME and USER/LOGNAME look like the most likely
candidates.  HOME is important because that controls where ssh(1) reads
various config settings and finds ssh keys etc.  USER/LOGNAME
effectively does the same for the remote end of the connection.  I'd
also double check what PATH and IFS are set to.

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.

	Cheers,

	Matthew



--u9QG9gUFWepNkuQQE0W85sajKMls0EuVX--

--1xRhfpwOcHpvM6cupwUV8NMW9EkXG57qE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJ8BAEBCgBmBQJXDfOzXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC
QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATxCwQAK9Y6Cxh80NPnLU3UcOa32YF
Zyz3H/gR4wHneaaRPQrJefGbZ+Q2Wem++EXLv7ELmSns4yJz+erwQrLqsIFOV/zT
Nt93XIBbhcOBiaTufBr1F0kVUDsB01UMeIolcuZcQfjIW4yYf3QK1gH4JF2dY9ev
FtT/7mF3+fqrjNdFRwl291paXD6W43INPWL/67UH4Wdml2HYoSzcE2IgnlixuNCy
QP+Q6O1j33WAs02SNvsgzCwFs9ik1pzZhYZRWAaetjAVraH3cBgyAC/tFWprovx0
DQiBJXAMwt7FqbFJ+PyuxKHI7jMxm/YB37fEcu7DxuNgwW2AIDuTqC0ko0xPNS74
G36iNGP6hampdx5t+t7jl7TdAn1SL8pwm71POdQeyn9SjivfVx7pxm6+oM8xmWQT
FLoASCtyA1b/4S8voz7nmDYpe/hjbROVZ6D4Zwe16f/PHx08EroktQOTQYw9XTmh
8V8DP7WAEJRepMK5EvSsmMI1UNVZobAGa+THuN1T78zlu5jUr7sIqtWsPnyMtqKN
VeQE3js8mXhrOCaIC8WfpspQ43Mqx0ry/N18G2LJ0dvrBpWHS4dKzSoz6qeets7X
OarLQBlwhqtOldGsR7RZrWsiJF2vZhEg8cATmO/rCpWExihfcb2hU5w/yVqp8lzQ
YN1+9f8FFWXVyu7qzy3d
=YnqW
-----END PGP SIGNATURE-----

--1xRhfpwOcHpvM6cupwUV8NMW9EkXG57qE--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?570DF3AC.1030501>