Rsync - hot to omit MOTD/banners

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Rsync - hot to omit MOTD/banners
# 1  
Old 09-28-2015
Rsync - hot to omit MOTD/banners

I'm working on an rsync script and I'd like it to omit the MOTD banners and NOT output them to the file. I tried the --no-motd argument in the command but for some reason the MOTD still continues to appear. Can anyone advise?
# 2  
Old 09-28-2015
Not output them to what file?
# 3  
Old 09-28-2015
Code:
#/bin/bash

command="rsync -ahvz -e ssh --delete --no-motd"
NOW=`date +%Y%m%d`
#OUTPUT=

# Command       Source Dir                              Dest Dir                                        Output
# -------       ----------                              ---------                                       -------

$command        /data/newfiles/jf-logs/                 sdc-mgmt-sr:/data/oldfiles/fj-logs/            >> /data/rsyslog/logs/rsync.log.$NOW 2>&1


Last edited by Corona688; 09-28-2015 at 01:31 PM..
# 4  
Old 09-28-2015
it may be sshd banner, not motd.

Code:
$ ssh server1 date
Internal System. Unauthorized access is prohibited.
Mon Sep 28 17:58:16 CEST 2015

vs.

Code:
$ ssh server1 date 2>/dev/null
Mon Sep 28 17:58:20 CEST 2015

# 5  
Old 09-28-2015
ok how do you supress the ssd banner then instead? think that is probably it
# 6  
Old 09-28-2015
You can ask the sysadmins to put a test in to see if the process is a batch process, rather than an interactive process and to only show the message when the process is interactive. As far as I know, doing an rsync is considered a batch process on the server that it is connecting to.
# 7  
Old 09-28-2015
I would expect an ssh banner to go to stderr, not stdout, I'm surprised >> is able to capture it. You could try --msgs2stderr but I suspect that will send more to stderr than you wanted.

Completely avoiding the ssh motd is difficult, that's something that's determined server side, not client side.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rsync Error: rsync: link_stat failed: No such file or directory (2)

I wish to copy all the files & folder under /web/Transfer_Files/data/ on mymac1 (Linux) to remote server mybank.intra.com (Solaris 10) /tmp/ location I am using Ansible tool synchronize module which triggers the unix rsync command as below:rsync --delay-updates -F --compress --archive --rsh=ssh... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. UNIX Desktop Questions & Answers

/etc/motd - queries

If I have /etc/motd, he is file or directory? I saw that some call them folders and files others... Which option is better? I knew that being a director, but many told me not. Thank you! (1 Reply)
Discussion started by: mescu
1 Replies

3. Red Hat

TCP banners for httpd

Can this be done for httpd also? Reading the manul it does not mention httpd at all. Basically, what I want to do is disable the ability of the user to see what type of system the web server is on. Can I:- 1. Add /etc/banners/httpd file and add some text in here. 2. Edit hosts.allow to... (1 Reply)
Discussion started by: psychocandy
1 Replies

4. UNIX for Advanced & Expert Users

Small linux distro for displaying advertisements/banners

Hi guys (& ladies) :) I'm looking for some good linux distribution to use on my new project. The project looks like this: - tiny computer (ethernet, D-sub, usb, etc), - big-screen monitor (min 40''). All it has to do is to display some .swf advertisement in fullscreen mode. (plus some extra... (4 Replies)
Discussion started by: sulti
4 Replies

5. Shell Programming and Scripting

Removing banners from scp calls (AIX/KSH)

Hello all! I am creating a script to synchronize key files on multiple servers in our environment. What I have works, but I am getting the banner for each of the servers in the output and it makes it difficult to quickly review when there are over a dozen servers in the array. I have tried a few... (4 Replies)
Discussion started by: cpare
4 Replies

6. Linux

Motd

In which login startup script is the motd displayed? Red Hat 4AS As I understand it, upon login (bash) it hits /etc/profile ~/.bash_profile ~/.bash_login ~/.profile I went through the scripts and the associated scripts (/etc/profile.d/*.sh) but don't see where it's being displayed... (5 Replies)
Discussion started by: BOFH
5 Replies

7. UNIX for Dummies Questions & Answers

Motd

Does anyone know how to get the IP Address of the connecting client to apear in the MOTD I am new to linux and I was wondering if this was possible thanks in advance. :D :confused: :D (4 Replies)
Discussion started by: DragonLenage
4 Replies

8. UNIX for Dummies Questions & Answers

/etc/motd

Hi I do get the message of the day upon logging in to my machine(Solaris 9). I do NOT have a .hushlogin file in my home directory. Any ideas :-) (7 Replies)
Discussion started by: run_time_error
7 Replies

9. Shell Programming and Scripting

replacing old motd with new motd

I need to replace the current /etc/motd text file with a new motd across 30+ servers. Which is the best way to do this? Shell script? sed? Does anyone have an example I can use? Thanks in advance. Unix people are the best!!! :) (2 Replies)
Discussion started by: antalexi
2 Replies
Login or Register to Ask a Question