<div dir="ltr"><span style="color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:14px;line-height:17.804800033569336px">Hi,</span><div><span style="color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:14px;line-height:17.804800033569336px"><br>
</span></div><div><span style="color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:14px;line-height:17.804800033569336px">I'm writing a program to use rsync to do something, and I want to keep the output of both in the same log file. My program is writing log to /var/log/my.log via syslog() LOG_LOCAL0. I tried to use rsync's '--log-file=/var/log/my.log' option; it seems to work to some extent, but have some problems: </span></div>
<div><span style="color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:14px;line-height:17.804800033569336px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:14px;line-height:17.804800033569336px">1. If I issue the rsync command directly on command line, rsync's log will be written to both the log file and the terminal (probably stdout). </span></div>
<div><span style="color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:14px;line-height:17.804800033569336px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:14px;line-height:17.804800033569336px">2. IF I run my own program (which invokes rsync), rsync's log/output won't be written to the log file, but only to the terminal/stdout. I guess it's because syslog() is also writing to this file. </span></div>
<div><span style="color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:14px;line-height:17.804800033569336px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:14px;line-height:17.804800033569336px">How can I redirect both's log to this log file, and without sending rsync's log to the terminal/stdout? Thanks.</span><br>
</div><div><span style="color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:14px;line-height:17.804800033569336px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:14px;line-height:17.804800033569336px">--tuma</span></div>
</div>