Sponsored Content
Top Forums Shell Programming and Scripting Please help me to figure out the logic for this problem Post 302392379 by tonijel on Thursday 4th of February 2010 08:43:14 AM
Old 02-04-2010
Please help me to figure out the logic for this problem

Hello,
i am on 2.6.13-1.1526_FC4smp
i have directory named /home , and in there i have directory 2009_10_10
and two files : 2009_10_10.log and 2009_10_11.log
How to write shell script which will delete only file/s that don't have his/their 'parent' directory, so in this case , only 2009_10_11.log would be deleted ?
Smilie
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with if logic

Hi there, In my shell program I have two if statements the first one checks that the date in yyyymm format is equal to a date from the parameter file in yyyymm format, and that the file and sends an appropiate email The second one checks that the date in yyyymm format is equal to a... (1 Reply)
Discussion started by: rjsha1
1 Replies

2. UNIX for Dummies Questions & Answers

if then else logic with while loop problem

Hi Friends, I have to do write a shell file based on one flag.If that flag value is 'N' then process look in $DATA are and the normal process continue.If vaule is 'P' then it check for the files in different location $CONV and move those file in $DATA area and rest of the process... (2 Replies)
Discussion started by: Param0073
2 Replies

3. Shell Programming and Scripting

Nawk if logic problem

nawk '{ fmt="%3s %22s %48s %35s %21s\n"; if ($3==$6 && $1=="STOPLOSS") { tpy="Successful Match"; jnme=$1; sts="File will be loaded"; cntrl=$3; audit=$6; printf (fmt, tpy,jnme,sts,cntrl,audit) >> "'${AUDIT_DATA_FILE}/${AUDIT36}'" }else if ($3!=$6 && $1=="STOPLOSS") { tpy="Mis-Match ";... (4 Replies)
Discussion started by: wawa
4 Replies

4. Shell Programming and Scripting

Help with change significant figure to normal figure command

Hi, Below is my input file: Long list of significant figure 1.757E-4 7.51E-3 5.634E-5 . . . Desired output file: 0.0001757 0.00751 0.00005634 . . . (10 Replies)
Discussion started by: perl_beginner
10 Replies
db_archive(8)						      System Manager's Manual						     db_archive(8)

NAME
db_archive - displays security database log files no longer involved in active transactions (Enhanced Security) SYNOPSIS
/usr/tcb/bin/db_archive [-alsv] [-h home] FLAGS
Write all pathnames as absolute pathnames, instead of relative to the database home directories. Specify a home directory for the data- base. The correct directory for enhanced security is /var/tcb/files. Write out the pathnames of all of the database log files, whether or not they are involved in active transactions. Write the pathnames of all of the database files that need to be archived in order to recover the database from catastrophic failure. If any of the database files have not been accessed during the lifetime of the current log files, db_archive does not include them in this output. It is possible that some of the files referenced in the log have since been deleted from the system. In this case, db_archive ignores them. When db_recover is run, any files referenced in the log that are not present during recovery are assumed to have been deleted and are not be recovered. Run in verbose mode, listing the checkpoints in the log files as they are reviewed. DESCRIPTION
A customized version of the Berkeley Database (Berkeley DB) is embedded in the operating system to provide high-performance database sup- port for critical security files. The DB includes full transactional support and database recovery, using write-ahead logging and check- pointing to record changes. The db_archive utility is provided for maintenance of the log files associated with the security database. It writes the pathnames of log files that are no longer in use (that is, no longer involved in active transactions), to the standard output, one pathname per line. These log files should be written to backup media to provide for recovery in the case of catastrophic failure (which also requires a snapshot of the database files), but they may then be deleted from the system to reclaim disk space. You should perform a db_checkpoint -1 before using db_archive. The secconfig utility can create a cron job that periodically checks the security log files and deletes those no longer in use, as deter- mined by db_archive. Be sure to coordinate this with the site backup schedule. The db_archive utility attaches to one or more of the Berkeley DB shared memory regions. In order to avoid region corruption, it should always be given the chance to detach and exit gracefully. To cause db_archive to clean up after itself and exit, send it an interrupt sig- nal (SIGINT). RETURN VALUES
The db_archive utility exits 0 on success, and >0 if an error occurs. ENVIRONMENT VARIABLES
If the -h option is not specified and the environment variable DB_HOME is set, it is used as the path of the database home. The home directory for security is /var/tcb/files. FILES
/var/tcb/files/auth.db /var/tcb/files/dblogs/* RELATED INFORMATION
Commands: db_checkpoint(8), db_dump(8), db_load(8), db_printlog(8), db_recover(8), db_stat(8), secconfig(8) delim off db_archive(8)
All times are GMT -4. The time now is 11:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy