SLAC PEP-II
BABAR
SLAC<->RAL
Babar logo
HEPIC E,S & H Databases PDG HEP preprints
Organization Detector Computing Physics Documentation
Personnel Glossary Sitemap Search Hypernews
Unwrap page!
Comp. Search
Who's who?
Meetings
FAQ Homepage
Archive
Environment
Administration
New User Info.
Web Info/Tools
Monitoring
Training
Tools & Utils
Programming
C++ Standard
SRT, AFS, CVS
QA and QC
Remedy
Histogramming
Operations
PromptReco
Simulation Production
Online SW
Dataflow
Detector Control
Evt Processing
Run Control
Calibration
Databases
Offline
Workbook
Coding Standards
Simulation
Reconstruction
Prompt Reco.
BaBar Grid
Data Distribution
Beta & BetaTools
Kanga & Root
Analysis Tools
RooFit Toolkit
Data Management
Data Quality
Event display
Event Browser
Code releases
Databases
Check this page for HTML 4.01 Transitional compliance with the
W3C Validator
(More checks...)

skimDelete

skimDelete is part of  SkimTools  package. It serves to do a deletion from disk of selected kanga files. I works directly querying and updating BBRORA or reading a list of files to delete from a text file and updating consequently BBRORA..
 

How skimDelete works

skimDelete works basically in this way: it deletes a file checking before that file was already backed-up (that is: the relative BBRORA's entry has import_status="0B"). If the check is positive then  skimDelete  unlinks that file from file-system, then modifies BBRORA updating the entry corresponding to that file with  import_status="B" (="only on-tape"). If the check is negative and the  --force  option isn't used, skimDelete skips that file; if the  --force  option is used, skimDelete unlink that file from file-system and tag the relative BBRORA's entry as "E" (="eliminated").
skimDelete can be:
  • List-driven: it gets a list of files to delete directly from a text file, deletes them (checking before the initial status of the files _0B_ ), then updates BBRORA.

  •  
  • Database-driven: skimDelete gets all BBRORA's entries tagged as "0B" ("on disk and on tape"). Each entry is supposed to correspond to a physical file (else skimDelete logs a WARNING message for the missing files); so  skimDelete  deletes each corresponding file and updates BBRORA tagging those entries as "B" (="only on tape").
The initial and final ("0B" and "B" by default) import_status's values can be changed with two command line options (see below). This means that if you choose as initial status "A", skimDelete will query BBRORA for all entries tagged as "A", and will start to delete the relative files. If you choose as final status "F", the entries relative to the deleted files will be tagged in BBRORA with import_status="F".
If  skimDelete  is List-driven, and you choose as initial status "A",  skimDelete  will check that each file's corresponding BBRORA entry has import_status="A"; else  skimDelete  will skip those files that don't match... If the  --force  option is used in this case, skimDelete will delete anyway those files, and will tag them with import_status="E".

skimDelete needs the SkimTools/site/<BFSITE>/localStage.pl in order to get the values of some needed variables.  See the skimBackup's documentation for details.

How to use skimDelete

The sintax of  skimDelete  is:

skimDelete --help                  to get help on available options
skimDelete --version     to get info on version/author/creation date

skimDelete --sql-pwdfile <PWD_FILE> [--fake] [--sql-host <SQL_HOST>] \
    [--sql-user <SQL_USER>] [--sql-db <SQL_DB>] [--sql-driver <SQL_DRIVER>] \
    [--log-file <ALTERNATE_LOGFILE_BASENAME>] [--log-dir <ALTERNATE_LOGDIR>] \
    [--stat <SOURCE_STATUS>] [--newstat <TARGET_STATUS>] \
    [--force] [--delete-list <FILE_LIST>]

As you can see there's only one mandatory argument; a simple "skimBackup --sql-pwdfile <PASSWORD_FILE>" command will delete all files tagged as "0B" tagging the corresponding BBRORA's entries as "B" and logging its work in directory $BFROOT/kanga/log. Of course you can change the default log directory with the proper command line option. You can also do a "FAKE" run, just to see what it should happen; and so on... see options.

Options meaning

  • --sql-host      specifies the machine running the sql server
  • --sql-driver    specifies the sql engine type (for now USE only "mysql", or don't use at all because DEFAULT="mysql")
  • --sql-user      specify a user name having read/write permission on BBRORA (BBRORA's administrator)
  • --sql-pwdfile   specify the file containing the BBRORA administrator's password
  • --sql-db        specify an alternative different from "bbrora" for BBRORA database
  • --log-file      speficy a different file-name for the log files (default is "skimDelete", just the program's name)
  • --log-dir       specifies a different directory where put the log files (DEFAULT="$BFROOT/kanga/log")
  • --fake          don't really do anything, just shows wath it should do
  • --stat          specifies the initial status of files to delete
  • --newstat       specifies the new status of files to delete
  • --force       Force the deletion even of those files not previously backed-up, tagging them as "E" (eliminated)
  • --delete-list   specifies a list file containing the file-names to delete; the format of each row MUST be:
        $BFROOT/kanga/EventStore/groups/...
        <$BFROOT>/kanga/EventStore/groups/...
        EventStore/groups/...
  • --version            shows version/history/author's information and exits
  • --help                   shows command's help and exits
Attention:
* The default value for --stat's argument is "0B", and the default value for --newstat's argument is "B". But you can change these initial and final status as you want. Remember that doing this you "re-define" the "ON-DISK AND ON TAPE" status and "ON TAPE ONLY" status for those entries and when you will use skimData, you will have to use --remote option with a proper argument . So it could be reasonable to change the initial status of files you want to backupdelete, but the final status shouldn't be something like "0*", because by default skimData returns kanga files tagged as "0" or "0B".
 

Log files

By default, the log files are put in $BFROOT/kanga/log, unless you re-define it with --log-dir ; there's just a main log file:
 
skimDelete.YYYYMMDD.<RUN>


In this log file you can find information on which file it's working about, under deletion, under database's updating (transaction `0B'=>`B', see import_status description). The logfile's base name "skimDelete" can be changed using --log-file="NEWNAME".
 
 



Page written by Alvise Dorigo
Alvise.Dorigo@pd.infn.it
Web Page
Last update: 13 March 2001.