LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to hide the messages that are displayed when a USB device is plugged in? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-hide-the-messages-that-are-displayed-when-a-usb-device-is-plugged-in-689047/)

tuttu47 12-08-2008 03:17 AM

How to hide the messages that are displayed when a USB device is plugged in?
 
Hai,

I'm new to Linux and am facing a li'l problem. I am running a script that copies some file from my pendrive to a folder. But the problem, when the script is running; and then I plug in my pendrive; the control goes out of the script (which is a menu box) and prints some messages like "detected High speed USB device" etc on the screen. How can I supress these messages; so that no other messages are displayed when my script is running?

Thanx in advance :-)

harry2006 12-08-2008 06:28 AM

I don't want why you want to do that. Anyways thats not the problem. What I can figure out from your mesasge is that you want to keep an offline backup of some folder in you pendrive, right?then rather than running your script manually everytime after plugging that USB device, why dont you put that "run script command" in the udev rules itself. I bet this will make life much easier though you've to put some effort initially learning udev, but it'll payoff in the long run.
Secondly, you dont want any message to be displayed whenever this copying process is going on, right? then just remove the notify message that is available in the .rule file in /etc/udev/rules.d/ directory meant for your USB device. Just learn how to add/modify these rules then you would be writing off nice rules to take backup or anything you like whenever a new device gets plugged.
For udev you may like to start here,
http://reactivated.net/writing_udev_rules.html
Hope it helps

tuttu47 12-08-2008 11:00 AM

Thanks a lot for the reply... But I believe my problem was not completely understood. I am running a bootup script that basically is a dialog utility; and it displays a menu with some options. But if i just plug in a usb when this menu is on display; all the "high speed device detected ..." etc is output to the screen; ie it is written over my menu. So what I want is that when my menu is displayed; whatever device is plugged in or out; no (a complete NO) messages should come on to the screen... my script (menu) should be undisturbed... (ie the screen should remain as it is...). I know its possible; but I just donno how... Any help is deeply thanked...


All times are GMT -5. The time now is 07:49 PM.