avpatil
17th October 2004, 14:52
Hi,
I havew a question- Can I delete everything from TMP directlry under $BSE? There ae various kinds of files like tmp*, qp*, audiT*,mssql*?
Thanks
Arvind
dave_23
17th October 2004, 17:50
hmm, I don't think you should have audit files there.. but the qp, bshell, tmp, srt files can be fairly safely removed as long as their originating process is gone.
if you have R.* files, you need to make sure something didn't go wrong with a bdbreconfig before you remove 'em..
Dave
malutz
18th October 2004, 08:43
Hej,
we remove everything that is older than 3 days in a job, no mather the file extension. So far we have not experianced any problems.
günther
18th October 2004, 10:18
For some sessions that run *very* long, you can run into problems. Be careful for finance and controlling jobs!
Also keep in mind, that re-printing needs that files.
Günther
bdittmar
18th October 2004, 10:26
[QUOTE=malutz]Hej,
Hello,
i aggree with malutz,
to prevent deleting of all files in BaaN tmp-dir we're running
find /daten/tmp -name "tmp*" -mtime +14 -exec rm -f {} \;
Deleting all "tmp" files are older than 14 days !
find /daten/tmp -name "tmp*" -size 0c -exec rm -f {} \;
Deleting all files with size = zero !
find /daten/tmp -name "qp*" -mtime +2 -exec rm -f {} \;
Deleting all "qp" files older than 2 days !
in cron.
Regards Bernd
avpatil
18th October 2004, 14:32
Hi,
Thanks for everyone reply. I have hoewever observed that some time say- "TRIAL BALANCE" didn't run porperly. But that was one time incident. I have deleted lot of files y'day and will see if I experience soem problem.
Arvind
dave_23
18th October 2004, 16:49
Looks like you're on NT.. if you want to automate it you
could download Active Perl and run my little perl program here
I think i started adapting it to read BSE_TMP from the environment,
but never finished.. So, this could be a guideline for someone wanting
to write their own...
#!/usr/bin/perl -w
# 86400 = 1 day
use Env;
( $#ARGV >= 0 ) or die "Usage: ",__FILE__," <Number of days to purge> <BSE_TMP>\n";
$days = $ARGV[0];
if ( $#ARGV > 0 ){
$directory = $ARGV[1];
}
# else{
# $directory = $BSE_TMP;
# }
opendir(DIR, $directory) or die "Can not open directory: $directory\n";
@files = readdir(DIR);
closedir(DIR);
chdir($directory);
foreach $file (@files) {
if ($file =~ /^tmp/o || $file =~ /^qp/o ){
$faccess = time - (stat("$file"))[8];
if ($faccess >= ($days * 86400) ){
unlink "$file";
}
}
}
tjbyfield
19th October 2004, 02:36
Our 'pd_loc' file is in this directory. If it happened that you did not down baan/print daemon every day then it would probably be incorrect to delete everything older than a day.
We use scripts that are similar to the examples posted by bdittmar
Terry
dave_23
19th October 2004, 03:32
That's a good point, But windows doesn't have a printer daemon.. Plus pd_lock just holds the pid of the printer daemon.. the only thing that this MIGHT affect is being able to rc.stop_pdaemon, (or maybe you could start 2 pdaemons) all around, no big deal..
Still though, its probably good practice not to delete them. On unix, look out for pd_lock and .licd6.X in $BSE/tmp.
The only things that can really get you are
A) Long running processess
B) tmp files that you wanted to reprint..
C) R-Files that you wanted to recover.
Dave
ecarceller
24th December 2006, 03:27
For those of you running on Windows if you have perl on your servers (If you don't you should :) ) you can take advantage of bernd's good "find" advices by using find2perl. The way this works is you replace find for find2perl. This will not execute the command but will generate the necessary perl code for it. You can then send it to a file with ">" so you can see, modify and improve the code (it is amazing how much you can learn that way) or you can pipe it to perl like this:
find2perl /daten/tmp -name "tmp*" -mtime +14 -exec rm -f {} \;|perl
That will execute the command as if were running the regular find in UX
I hope that helps
I personally think it is very neat.