SOLVED, BUT UGLY, was Re: rsync update mixed environment

David Benfell benfell at parts-unknown.org
Wed Apr 13 10:30:46 UTC 2016



On 04/13/2016 12:22 AM, Matthew Seaman wrote:
> So, rsync works fine if called directly from the command line, but fails
> 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=
RSYNC_ICONV=
RSYNC_PROTECT_ARGS=
RSYNC_RSH=
RSYNC_PROXY=
RSYNC_PASSWORD=
USER=benfell
LOGNAME=benfell
HOME=/home/benfell
PATH=/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/bin:/opt/aws-elb-tools/bin:/opt/aws-iam-tools/bin:/opt/aws-rds-tools/bin:/usr/bin/cdsclient:/opt/cuda/bin:/opt/ekopath/bin:/usr/ti-linux-gnu/tigcc-bin/4.1.2:/usr/ti-linux-gnu/bin
IFS=   
^@


<snip>

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
>
>

-- 
David Benfell, Ph.D.
benfell at parts-unknown.org


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20160413/c9d40af2/attachment.sig>


More information about the freebsd-questions mailing list