Chris Adams
2011-Nov-22 23:40 UTC
question about why rsync log doesn't include remot ip or remote host
Hello all, This is my first post to this mailing list. I have been using rsync for a bit and have it mostly working the way I want. I have a backup server that I run all scripts from. It rsyncs data from four different Linux servers via cron. A sample of a script is here: rsync -avz --log-format="%t %b %f %l %M" --delete --stats -e "ssh -i /root/rsync/authors-rsync-key" backup at mydomain.com:/disk2/www /backup/seic37 2>&1 >> /var/log/rsync/rsync.log This works fine and I get the log file entry that shows this: 2011/11/22 13:20:51 2089 acad0304/alllibdirstaff.MYI 2048 2011/08/31-12:46:20 I would like to include the IP and/or hostname of the machine being backed up, but when I use %a (remote IP) or %h (remote host) in the -log-format=, it just writes the literal %a or %h in those fields. Could this be because I am running scripts from the machine that is on the receiving end. Inspire me. Thanks. Christopher Adams Library Systems Coordinator Oregon State Library chris.a.adams at state.or.us 503-378-5031 503-932-1004 (IT support) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20111122/d063f7c5/attachment.html>
Kevin Korb
2011-Nov-23 00:25 UTC
question about why rsync log doesn't include remot ip or remote host
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Those variables only apply to connections to an rsyncd service. Since you are using ssh for the networking rsync doesn't really have that information. Also, since you are pulling backups rather than pushing them if you switched to rsyncd instead of ssh it the %a and %h it would log would be that of your backup server not the machine you are connecting to. On 11/22/11 18:40, Chris Adams wrote:> Hello all, > > > > This is my first post to this mailing list. I have been using rsync > for a bit and have it mostly working the way I want. > > > > I have a backup server that I run all scripts from. It rsyncs data > from four different Linux servers via cron. A sample of a script is > here: > > > > rsync -avz --log-format="%t %b %f %l %M" --delete --stats -e "ssh > -i /root/rsync/authors-rsync-key" backup at mydomain.com:/disk2/www > /backup/seic37 2>&1 >> /var/log/rsync/rsync.log > > > > This works fine and I get the log file entry that shows this: > > > > 2011/11/22 13:20:51 2089 acad0304/alllibdirstaff.MYI 2048 > 2011/08/31-12:46:20 > > > > I would like to include the IP and/or hostname of the machine > being backed up, but when I use %a (remote IP) or %h (remote host) > in the ?log-format=, it just writes the literal %a or %h in those > fields. Could this be because I am running scripts from the machine > that is on the receiving end. > > > > Inspire me. Thanks. > > > > > > Christopher Adams > > Library Systems Coordinator > > Oregon State Library > > chris.a.adams at state.or.us > > 503-378-5031 > > 503-932-1004 (IT support) > > > > >- -- ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~ Kevin Korb Phone: (407) 252-6853 Systems Administrator Internet: FutureQuest, Inc. Kevin at FutureQuest.net (work) Orlando, Florida kmk at sanitarium.net (personal) Web page: http://www.sanitarium.net/ PGP public key available on web site. ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7MPW4ACgkQVKC1jlbQAQft7QCgtj/B9857sb5AaC9MwV6J/OwQ VzgAn3HOdV4zTiaaMGkYGmkHhIMhOPuK =OEJM -----END PGP SIGNATURE-----
Wayne Davison
2011-Nov-24 15:57 UTC
question about why rsync log doesn't include remot ip or remote host
On Tue, Nov 22, 2011 at 3:40 PM, Chris Adams <chris.a.adams at state.or.us>wrote:> I would like to include the IP and/or hostname of the machine being > backed up >Since you are initiating the transfer of a remote machine, you can put whatever you like into your log string option as literal characters or an $ENVVAR (which is substituted into literal characters by your shell). ..wayne.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20111124/bc69ea66/attachment.html>