How to Delete Dataset Replicas from LOCALGROUPDISK
Prerequisites
- A linux shell with DQ2 clients loaded.
- In the instructions below, a sample users DN is used as an example. The user should substitute their own DN. If the DN is not known:
- Create a proxy cert and run
grid-proxy-info
- Alternately, if there is a copy of the user cert in .pem format, you can run
openssl x509 -in usercertfile.pem -noout -subject
.
- MWT2_UC_LOCALGROUPDISK is used as the site. If the user has datasets stored at another site, they should substitute that name.
- Users should keep in mind that if they had a DOEGrid cert before the conversion to DigiCert, they will need run commands with both DOEGrid and DigiCert DNs.
- If the users DOEGrid cert is not available or expired, they may not have sufficient permissions to delete their datasets. They will need to contact someone with advanced privileges in order to delete it. In the US this is usually Armen Vartapetian, vartap@uta.edu.
Note: It is often helpful to redirect output of the following commands to a file.
Get list of dataset replicas owned by the users DN:
dq2-list-dataset-site2 MWT2_UC_LOCALGROUPDISK -o \
"/dc=com/dc=digicert-grid/o=open science grid/ou=people/cn=sample user 000"
List size of a user's dataset:
dq2-list-dataset-site2 MWT2_UC_LOCALGROUPDISK -o \
"/dc=com/dc=digicert-grid/o=open science grid/ou=people/cn=sample user 000" -0 -e
This command outputs the dataset name, number of replicas, date of the last operation on the dataset, date the dataset was created, date the replica was created, and dataset size. The output fields are separated by commas. If you store the output in text file and rename it to have a .csv extension, it can be imported into a spreadsheet.
List total size of files:
dq2-list-dataset-site2 MWT2_UC_LOCALGROUPDISK -o \
"/dc=com/dc=digicert-grid/o=open science grid/ou=people/cn=sample user 000" -s
Select all datasets with a certain string in the name, say SMWZ, and store the output in a file in suitable format to run the deletion command.
dq2-list-dataset-site2 MWT2_UC_LOCALGROUPDISK -o \
"/dc=com/dc=digicert-grid/o=open science grid/ou=people/cn=sample user 000" | grep SMWZ >& input.txt
Deleting datasets:
Delete all the datasets listed in a file:
cat input.txt | while read dataset; do dq2-delete-replicas $dataset MWT2_UC_LOCALGROUPDISK; done >& delete_SMWZ.log &
Read through delete_SMWZ.log carefully afterwards. If there are errors about insufficient permissions to delete a dataset, those dataset will need to be submitted for deletion by someone with additional privileges.
--
SarahWilliams - 07 Oct 2013