Click to See Complete Forum and Search --> : script info


TonyB
08-28-2002, 11:02 PM
I was searching for bash scripts, when I found this:

http://sourceforge.net/snippet/detail.php?type=snippet&id=100543

It is called 'maintanence'. Is there a reason why this script should not be used? At the commandline I did:
find / -name "core"
One hit was /dev/core. This is linked to ../proc/kcore, this is a large file on my system, about .4mg. I'm not sure what this is.

Any info appreciated

TIA

X_console
08-28-2002, 11:18 PM
http://www.unixguide.net/linux/faq/04.16.shtml

TonyB
08-29-2002, 07:21 AM
Thanks for the reply.

OK, if any of the "core" , or any file that does not exist is deleted, I assume this is OK? I don't want to delete anything that may cause problems.

Is the script safe? From what I can tell it is, but I'm trying to learn scripting.

TIA

TonyB
08-29-2002, 04:49 PM
I found out what a "core" file is. This is a memory dump of a program that has crashed, they are not needed............

bwkaz
08-29-2002, 05:45 PM
Yes, but DON'T DELETE ANYTHING IN /dev!

Please, trust me, you don't want to. Most programs have no business looking at /proc/kcore (or /dev/core, either which one), which is why only root has access to it. But still, there might be some that need it (I'm thinking X here, but I'm not sure, because there should be other ways to get at some of that info).

Normally, core files are the image of a process' memory when it crashed. They're used by debuggers to figure out what was going on at the point of failure. You don't want them around for too long because they could give things away about your system that certain people (crackers) could use to cause harm. But at least Mandrake (and I would guess a good number of other distros) installs with the user limit for core file size set to 0 -- which disables them altogether. Check the output of ulimit -c -- if it's 0, then you won't ever get core files, and running that part of that script is kinda pointless.

TonyB
08-29-2002, 05:50 PM
You are correct, ulimit -c =0. I will delete that part of the script.

Thanks...