I have a Linux server, and it's doing a lot of disk io. There is one process that is doing most of the disk writes. I found this out with iotop
, which shows the processes that are doing disk I/O. Is there an equivant programme (in the debian lenny apt repositories) that will show me what files are being written to? a 'top' like interface would be great? Is this even possible?
Amandasaurus's questions
Like most sysadmins I use openssh all the time. I have about a dozen ssh keys, I like to have a different ssh key for each host. However this causes a problem when I am connecting to a host for the first time, and all I have is a password. I want to just connect to the host using a password, no ssh key in this case. However the ssh client will offer all the public keys in my ~/.ssh/
(I know this from looking at the output of ssh -v
). Since I have so many, I will get disconnected for too many authentication failures.
Is there some way to tell my ssh client to not offer all the ssh keys?
I have a debian (well technically ubuntu) source package, i.e. the .dsc, the .tar.gz, etc., I want to build this. The dpkg-buildpackage
fails, since I don't have all the build dependencies.
Normally I'd use apt-get build-dep
, but this package isn't in apt.
Is there a 'clean', 'proper' way to install all the build dependencies, given a source package. I know I could just open the debian/control file, but I'm curious if there's a 'proper' way.
I have installed build-essential
, and have all the normal compilers etc., this package requires extra software.
I am rsyncing a few directories. I have a bash terminal open and am executing something like this:
for DIR in * ; do rsync -a $DIR example.com:somewhere/ ; done
However if I want to stop the whole things, I press Control-C. That stops the rsync, but then it keeps going to the next one. In this case I realize what has happened and then just press Control-C like a madman until things work again.
Is there some way to 'fix' this. I want it so if I have a loop like that, and press Control-C, that it will return me to my bash shell.
I am doing a backup of my desktop to a remote machine. I'm basically doing rsync -a ~ example.com:backup/
However there are loads of large files, e.g. wikipedia dumps etc. Most of the files I care a lot about a small, such as firefox cookie files, or .bashrc
. Is there some invocation to rsync that will exclude files that are over a certain size? That way I could copy all files that are less than 10MB first, then do all files. That way I can do a fast backup of the most important files, then a longer backup of everything else.
I recently discovered the 'moreutils' package in Debian (and Ubuntu). It's a collection of convenient unix tools.
One of the commands is 'pee'. The man page says:
pee is like tee but for pipes.
However it's a short man page, I have filed a bug about it. Does anyone know what it does, how to use it, why one would use it?
How can I see when a process started, assuming I know the pid. (On Linux)
I'm backing up a Linux server and storing it on another server.
I began with a simple
rsync -aPh --del server.example.com:/ /mnt/backup
Then someone pointed out that I shouldn't back up /proc
, since you don't want to restore the /proc
of one server on another.
Is there anything else that I should/shouldn't include?
For instance, what about /sys
?
I have a server that has a really high load. Nothing is jumping out at me in terms of CPU usage, and it's not swapping.
I think it's cause some processes are waiting for disk IO, and I want to see what's waiting.
Is there any programme that'll show me what processes are waiting for IO? I know about iotop
but that shows what's currently doing IO.
Or is this a silly question? (If so explain how :) )
Server A used to be a NFS server. Server B was mounting an export of that. Everything was fine. Then A died. Just switched off. Gone. Vanished.
However that folder is still mounted on B. I obviously can't cd
into it or anything. However umount /mnt/myfolder
just hangs and won't umount. Is there anyway to umount it without restarting B?
Both client and server are Linux machines.
Lets say I have a webserver, called 'www'. www.example.com resolves to the IP address of that machine. Then I wanna make some virtual hosts, and DNS records for them, like webmail.example.com.
For 'webmail', should I put in an A record with www's IP address, or should I do a CNAME to www?
What's 'cleaner?, more robust? better?
Let's suppose I have a SSH key, but I've deleted the public key part. I have the private key part. Is there some way I can regenerate the public key part?
The more I use rsync
the more I realise that it's a swiss army knife of file transfer. There are so many options. I recently found out that you can go --remove-source-files
and it'll delete a file from the source when it's been copied, which makes it a bit more of a move, rather than copy programme. :)
What are you favorite little rsync tips and tricks?
I have to copy a large directory tree, about 1.8 TB. It's all local. Out of habit I'd use rsync
, however I wonder if there's much point, and if I should rather use cp
.
I'm worried about permissions and uid/gid, since they have to be preserved in the copy (I know rsync does this). As well as things like symlinks.
The destination is empty, so I don't have to worry about conditionally updating some files. It's all local disk, so I don't have to worry about ssh or network.
The reason I'd be tempted away from rsync, is because rsync might do more than I need. rsync checksums files. I don't need that, and am concerned that it might take longer than cp.
So what do you reckon, rsync
or cp
?
I've got SSH passwordless set up, however it prints the MoTD when it logs in. Is there anyway to stop that happening from the client side?
I've tried ssh -q
but that doesn't work. I don't want to use ~/.hushlogin
nor do I want to change the server set up. The only thing that can work is to quiet all output, with >/dev/null 2>&1
. However, I don't want to ignore errors in case there actually is a problem. Even doing >/dev/null
doesn't work, since ssh
seems to print the motd to the stderr.
Update & reasoning I'm running backup in a cron. I don't want to get a cron email unless an error has occured. However if the motd is printed I'll get an email all the time.
I want to keep the motd being printed because that has legal implications. The motd says "unathorized access prohibited". You need to have this sort of statement in there to legally prevent people from access it (like a no trespassing sign). Hence I don't want to blanket disable it all the time.
Is there anyway to show all the locks that are active in a mysql database?
What's the username and password for an Ubuntu Live CD image?
I ask because I've recently copied the contents of an Ubuntu based live ISO (easypeasy, the ldistro for nwtbooks) onto a hard disk drive, but the Squashfs file system is corrupt, most likely because I copied it live. :) So it's not autologging in. Is there a username/password for this?
Update: I tried username Ubuntu and a blank password, and it didn't work.
I'm using postfix for my email. I know I can use /etc/aliases and newaliases command to redirect certain email, eg I can redirect [email protected] to [email protected] by putting root: user
in my /etc/aliases and then running newaliases
. However I'd like to do the equivilant of *: user
, so that all email to example.com will get sent to [email protected].
How do I do this?