LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   xarg command (https://www.linuxquestions.org/questions/linux-newbie-8/xarg-command-396614/)

leandean 12-26-2005 01:35 PM

xarg command
 
Greetings and Happy Holidays,

I have a machine with a three hdd RAID5. One drive failed completely and another had some (11) bad sectors. After replacing the failed drive I did a forced rebuild, rebuild tree, etc. I then replaced the drive with the bad sectors and rebuilt again.

The machine appears to be fine but to be sure I want to verify all the RPM packages.
I created a list of all the packages using the RPM query command. Now I want to verify that the packages are okay.

A friend suggested using xarg with the list I created to automate the task. There lies the rub. Documentation for xarg is scarce. After reading AwesomeMachines excellent DD command article the brain bulb lit up and came up with this post.

Not sure if it matters, but the machine:

SuSE 9.2 Pro
3Ware 8506
3 x 250GB SATA HDD
2.4GHz Xeon
2GB RAM
Intel board
This is a backup machine.

Thanks in advance.

MassDosage 12-27-2005 10:26 AM

One uses xargs to pass the output from one command as arguments to another command. So you can get a list of all the RPM's on your system by using

rpm -qa

and then have these handed over to another program using xargs. The question is, what is the command you want to call on the rpms to ensure that they are ok? I'm quessing you want to call "rpm --verify" in which case the entire command would look like:

rpm -qa | xargs rpm --verify

leandean 12-27-2005 11:07 PM

Verify it is! Thanks a bunch. So as long as the -qa option passes output to the xargs option it will keep processing --verify? I'll pipe this into a text file and give it a try.


All times are GMT -5. The time now is 11:54 PM.