You are here: TWiki> Online Web>RunDatabaseTool (2010-04-19, RainerSchwemmer)
Tags:
create new tag
, view all tags

Removal of runs with a "LOCAL" destination

The policy (part of the datamover soon) is to delete them once the daqarea occupancy reaches a certain high watermark (~90%) until there is at least 50% available again, starting from oldest files first.

Syntax

With the RunDatabaseTool you can check runs for their status.

RunDatabase_Tool.py [options] runid1
RunDatabase_Tool.py [options] runid1 runid2
RunDatabase_Tool.py [options] startTime
RunDatabase_Tool.py [options] startTime endTime


options:
  -h, --help            show this help message and exit
  -b, --bookkeeping     Get bookeeping infos for a run
  -c DESTINATION, --changedestination=DESTINATION
                        Change the destination.
  -d, --dryrun          Do not make any real changes.
  -f, --files           Show details for all files.
  -o, --outputdir       Show path of output directory.
  -p PARTITION, --partition=PARTITION
                        Show only runs from the given partition.
  -r RUNTYPE, --runtype=RUNTYPE
                        Show only runs with the giben runtype.
  -x, --increment-refcount
                        Increase the refcount by one.
  -y, --decrement-refcount
                        Decrease the refcount by one.

Tip, idea Instead of typing RunDatabase Tool.py you can also use the shorter notation _rdbt

In fact using rdbt is safer since it sets up the environment properly before calling the real python script.

Examples

Show Information about run 30194 and its files

rdbt 30194 -f

Get all runs with the runids between 30100 and 30200, including bookkeeping information

rdbt -b 30100 30200

Get all runs between 2008/10/01 and now

rdbt 2008/10/01

Get all runs between 2008/10/01-10:30:10 and 2008/10/15-10:30:20

rdbt 2008/10/01-10:30:10 2008/10/15-10:30:20

Increase the reference counter for all files of run 35035:

rdbt -fx 35035

Search by runids

RunDatabase_Tool.py [options] runid1

If you provide one runid the tool will list all files and their status of this run if the run can be found.

RunDatabase_Tool.py [options] runid1 runid2

If you provide two runids the tool will list all files and their status in the range of runs from the smaller runid until the greater runid.

Search by date and time

RunDatabase_Tool.py [options] startTime

If you provide one date this will be taken as the start date and the end date will be set to today and all runs in the range between these two days will be found

RunDatabase_Tool.py [options] startTime endTime

If you provide a start date and a end date all runs in the range between these two dates will be found

Help The format of startTime and endTime should be YYYY.MM.DD, YYYY.MM.DD-HH:mm or YYYY.MM.DD-HH:mm:ss.

Tip, idea Slashes will be converted to points so it is also possible to provide the date like YYYY/MM/DD

Options

-h, --help

Shows some help

-f, --files

With the -f option the tool will also show all files and their status. You can also see if the files are already in CASTOR.

-c DESTINATION, --changedestination=DESTINATION

With this option you can change the destination for the files of a run. Available options are CASTOR, OFFLINE and LOCAL.

CAUTION: Use this option with Caution. A run which has been designated to CASTOR can not be move to OFFLINE anymore and vice versa.

e.g.

rdbt 30194 30199 -c OFFLINE

would set the destination of all available runs between 30194 and 30199 to OFFLINE.

-p PARTITION, --partition=PARTITION

rdbt -p TT

Will search only for runs with the given partitionname.

-r RUNTYPE, --runtype=RUNTYPE

rdbt -r TEST

Will search only for runs with the given runtype.

Help Please notice that the pipe symbol | is a special symbol for the console and you have to use quotings for your arguments. e.g.

rdbt -r "TEST|VFS400" 

-d, --dryrun This option will prevent the script from changing real data. With this option the script will only show what would be changed. So e.g. it is possible to run

rdbt 30194 30199 -c OFFLINE --dryrun

and see which runs would be affected.

-x, --increment-refcount

This option will increase the refcount by one so that the DataMover will try to keep the file in the daqarea.

-y, --decrement-refcount

This option will decrease the refcount by one so that the DataMover. If the refcount reaches 0, the DataMover will try to delete this file from the daqarea if its already successfully copied to CASTOR. If you call this option on runs which have files with refcount of 0, nothing will happen (you can not have a negative refcount).

-b, --bookkeeping

If you set the optional flag -b or --bookkeeping the tool will also show the status of the files in the bookkeeping database.

Help This option will work as soon as DIRAC was updated on lbgw

-- DanielSonnick - 30 Sep 2008

Edit | Attach | PDF version | Print version |  | Raw View | Raw edit | Backlinks | History: r13 < r12 < r11 < r10 < r9 | More topic actions
Topic revision: r13 - 2010-04-19 - RainerSchwemmer
 

TWIKI.NET
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback