Been looking to do some cleanup and I wanted an easy way to do it. So...I wrote this script. I can take the list returned and either make it a macro or an internal TSM script. Sure I could build a shell script that processed a list with the TSM server_name, the node_name, and FSID but I thought I'd show how you can create a command out of SQL returned data.
select 'del filespace ' || node_name || ' ' || cast(FILESPACE_ID as char(3)) || ' type=backup nametype=fsid wait=yes' AS COMMAND from filespaces where cast((current_timestamp-backup_end)days as decimal)>90
Here is an example of the results from the script:
COMMAND
------------------------------------------------------------
del filespace NODE1 37 type=backup nametype=fsid wait=yes
del filespace NODE1 9 type=backup nametype=fsid wait=yes
del filespace NODE1 36 type=backup nametype=fsid wait=yes
del filespace NEO_1 32 type=backup nametype=fsid wait=yes
del filespace NEO_1 31 type=backup nametype=fsid wait=yes
del filespace NEO_1 23 type=backup nametype=fsid wait=yes
del filespace NEO_1 29 type=backup nametype=fsid wait=yes
Showing posts with label cleanup. Show all posts
Showing posts with label cleanup. Show all posts
Friday, April 29, 2011
Delete Old Filespaces
Been looking to do some cleanup and I wanted an easy way to do it. So...I wrote this script. I can take the list returned and either make it a macro or an internal TSM script. Sure I could build a shell script that processed a list with the TSM server_name, the node_name, and FSID but I thought I'd show how you can create a command out of SQL returned data.
select 'del filespace ' || node_name || ' ' || cast(FILESPACE_ID as char(3)) || ' type=backup nametype=fsid wait=yes' AS COMMAND from filespaces where cast((current_timestamp-backup_end)days as decimal)>90
Here is an example of the results from the script:
COMMAND
------------------------------------------------------------
del filespace NODE1 37 type=backup nametype=fsid wait=yes
del filespace NODE1 9 type=backup nametype=fsid wait=yes
del filespace NODE1 36 type=backup nametype=fsid wait=yes
del filespace NEO_1 32 type=backup nametype=fsid wait=yes
del filespace NEO_1 31 type=backup nametype=fsid wait=yes
del filespace NEO_1 23 type=backup nametype=fsid wait=yes
del filespace NEO_1 29 type=backup nametype=fsid wait=yes
select 'del filespace ' || node_name || ' ' || cast(FILESPACE_ID as char(3)) || ' type=backup nametype=fsid wait=yes' AS COMMAND from filespaces where cast((current_timestamp-backup_end)days as decimal)>90
Here is an example of the results from the script:
COMMAND
------------------------------------------------------------
del filespace NODE1 37 type=backup nametype=fsid wait=yes
del filespace NODE1 9 type=backup nametype=fsid wait=yes
del filespace NODE1 36 type=backup nametype=fsid wait=yes
del filespace NEO_1 32 type=backup nametype=fsid wait=yes
del filespace NEO_1 31 type=backup nametype=fsid wait=yes
del filespace NEO_1 23 type=backup nametype=fsid wait=yes
del filespace NEO_1 29 type=backup nametype=fsid wait=yes
Subscribe to:
Posts (Atom)