Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Can you do remove core file based on what created them :( Post 303035019 by newbie_01 on Saturday 11th of May 2019 04:26:32 AM
Old 05-11-2019
Can you do remove core file based on what created them :(

Hi,

Currently, we have a Perl script from a third-party vendor that is generating core dumps. It has been reported. We can't turn off the script as it does generate some diagnostic file that's required. So at the moment, we have to let it continue to do its run.

I wish I can say the vendor is dependable enough to help us cleanup the core dumps but unfortunately they aren't, hence am here asking for help.

Is it possible to check that the core dump belongs to this script or were generated by this script before removing it? I can do a non-recursive find below and change the ls -l to a rm

Code:
find . -name "core\.*" -mtime +10 -maxdepth 1 -exec ls -l {} \;

But I am a bit concern that I may remove core files that we needed that belong to other processes? Also, how do I change the regex so that is does a find fo core\.<numbers-only>

Any feedback much appreciated. Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File management based on date created

Hi There, I was wondering how to manage files (ie. rm, cp , mv) based on date last modified and date created. ie. Say i want to: mv ./* ./temp/* (where the date created < 29/1/2006 ) or mv ./* ./temp/* (where the date modified > 27/1/2006 && date modified < 29/1/2006) Thanks in... (1 Reply)
Discussion started by: Geehog_Rare
1 Replies

2. AIX

Why a core file is created whenever I send a mail in AIX

Whenever i send a mail like: mail <mail id>, a core file is created under /var/spool/mqueue/ path. This is increasing the space of the file system. Why is that core file get created. Does it happens normally. I am getting an errpt error as: LABEL: CORE_DUMP IDENTIFIER: B6048838 ... (0 Replies)
Discussion started by: sreereddy
0 Replies

3. Shell Programming and Scripting

Remove lines based on contents of another file

So, this issue is driving me nuts! I was hoping to get a lending hand here... I have 2 files: file1.txt contains: this is example1 this is example2 this is example3 this is example4 this is example5 file2.txt contains: example3 example5 Basically, I need a script or command to... (4 Replies)
Discussion started by: bashshadow1979
4 Replies

4. Shell Programming and Scripting

How to keep appending a newly created file based on some keywords

Hi Friends, I have to create a new log file everyday and append it with content based on some keywords found in another log file. Here is what I have tried so far... grep Error /parentfolder/someLogFile.log >> /parentfolder /Archive/"testlogfile_error_`date '+%d%m%y'`.txt" grep error... (6 Replies)
Discussion started by: supreet
6 Replies

5. Shell Programming and Scripting

Rename File Based on Created Date

I am trying to rename files based on the created/born date of the file. I Have a total of 4000 files that i am trying to do this with and would like it to be log_yyyymmddhh.gz right now the files are maillog.???.gz. Can anyone point me in the right direction of how to get this done via scipt? ... (4 Replies)
Discussion started by: Paulb
4 Replies

6. Shell Programming and Scripting

How remove the file which was created by another user?

When I try to remove the file which was created by another user through super user, I am getting the "override protection 644 " meesage. Could you please anyone help me how will I delete the file without prmpting the override protection. I have also given the permission (rwx) to the group as... (3 Replies)
Discussion started by: kandi.reddy
3 Replies

7. Homework & Coursework Questions

how to delete core file (file created due to apps crashed)

1. The problem statement, all variables and given/known data: When looking for corefiles, include any file with core in its name. (Some UNIX/Linux systems add the PID of the process that created the core to reduce the chances of overwriting an already existing core file that might be needed. The... (6 Replies)
Discussion started by: s3270226
6 Replies

8. Shell Programming and Scripting

Remove part of a file based on identifiers

here below is a part of the file cat fileName.txt NAME=APP-VA-va_mediaservices-113009-VA_MS_MEDIA_SERVER_NOT_PRESENT-S FIXED=false DATE= 2013-02-19 03:46:04.4 PRIORITY=HIGH RESOURCE NAME=ccm113 NAME=APP-DS-ds_ha-140020-databaseReplicationFailure-S FIXED=false DATE= 2013-02-19... (4 Replies)
Discussion started by: vivek d r
4 Replies

9. Shell Programming and Scripting

Remove or rename based on contents of file

I am trying to use the two files shown below to either remove or rename contents in one of those files. If in file1.txt $5 matches $5 of file2.txt and the value in $1 of file1.txt is not "No Match" then that value is substituted for all values in $5 and $1 of file2.txt. If however in $1 ... (5 Replies)
Discussion started by: cmccabe
5 Replies

10. AIX

Advice on why Core file is not being created

We have a user where a process is behaving abnormally and crashing. It would be great if a core file was generated, but I don't see one. user101671:/apps/ -$lscore -d compression: on path specification: on corefile location: /opt/core naming specification: off There is no core file being... (3 Replies)
Discussion started by: netmaster
3 Replies
lib::core::only(3pm)					User Contributed Perl Documentation				      lib::core::only(3pm)

NAME
lib::core::only - Remove all non-core paths from @INC to avoid site/vendor dirs SYNOPSIS
use lib::core::only; # now @INC contains only the two core directories To get only the core directories plus the ones for the local::lib in scope: $ perl -Mlib::core::only -Mlocal::lib=~/perl5 myscript.pl To attempt to do a self-contained build (but note this will not reliably propagate into subprocesses, see the CAVEATS below): $ PERL5OPT='-Mlib::core::only -Mlocal::lib=~/perl5' cpan DESCRIPTION
lib::core::only is simply a shortcut to say "please reduce my @INC to only the core lib and archlib (architecture-specific lib) directories of this perl". You might want to do this to ensure a local::lib contains only the code you need, or to test an App::FatPacker tree, or to avoid known bad vendor packages. You might want to use this to try and install a self-contained tree of perl modules. Be warned that that probably won't work (see "CAVEATS"). This module was extracted from local::lib's --self-contained feature, and contains the only part that ever worked. I apologise to anybody who thought anything else did. CAVEATS
This does not propagate properly across perl invocations like local::lib's stuff does. It can't. It's only a module import, so it only affects the specific perl VM instance in which you load and import() it. If you want to cascade it across invocations, you can set the PERL5OPT environment variable to '-Mlib::core::only' and it'll sort of work. But be aware that taint mode ignores this, so some modules' build and test code probably will as well. You also need to be aware that perl's command line options are not processed in order - -I options take effect before -M options, so perl -Mlib::core::only -Ilib is unlike to do what you want - it's exactly equivalent to: perl -Mlib::core::only If you want to combine a core-only @INC with additional paths, you need to add the additional paths using -M options and the lib module: perl -Mlib::core::only -Mlib=lib # or if you're trying to test compiled code: perl -Mlib::core::only -Mblib For more information on the impossibility of sanely propagating this across module builds without help from the build program, see http://www.shadowcat.co.uk/blog/matt-s-trout/tainted-love <http://www.shadowcat.co.uk/blog/matt-s-trout/tainted-love> - and for ways to achieve the old --self-contained feature's results, look at App::FatPacker's tree function, and at App::cpanminus's --local-lib-contained feature. AUTHOR
Matt S. Trout <mst@shadowcat.co.uk> LICENSE
This library is free software under the same terms as perl itself. COPYRIGHT
(c) 2010 the lib::core::only "AUTHOR" as specified above. perl v5.14.2 2011-02-18 lib::core::only(3pm)
All times are GMT -4. The time now is 05:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy