tag:blogger.com,1999:blog-13518440.post7167263661765583474..comments2023-12-12T04:39:52.103-08:00Comments on TSMAdmin: Delete Old FilespacesChad Smallhttp://www.blogger.com/profile/02637281120881655693noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-13518440.post-55459299139049290802012-08-09T15:07:48.245-07:002012-08-09T15:07:48.245-07:00I usually don't automate deletions. I run the ...I usually don't automate deletions. I run the report and double check my results then run the macro through a different script. You can send the output to a file and run the file as a macro from the TSM admin command line. Pretty easy to do if you know shell scripting.Chad Smallhttps://www.blogger.com/profile/02637281120881655693noreply@blogger.comtag:blogger.com,1999:blog-13518440.post-58396368080792233152012-08-09T14:50:42.962-07:002012-08-09T14:50:42.962-07:00When I run the SQL statement, the filespaces aren&...When I run the SQL statement, the filespaces aren't deleted--all it does it output the "del filspace..." text. How do you get it to actually execute the delete commands?Paulhttps://www.blogger.com/profile/15636417675967377913noreply@blogger.comtag:blogger.com,1999:blog-13518440.post-4118036840510826862011-08-05T09:02:20.832-07:002011-08-05T09:02:20.832-07:00Thank you for the script. One more question, how ...Thank you for the script. One more question, how do you create a custom script on the server, sorry total newbie with not proper training. I did look on the TSM ISC but it looked like it wanted me to pick a specific task. Furthermore, I would prefer to use the command line. If you could show me how to create the custom script within TSM that would be fantastic.<br /><br />Thank you so much.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-13518440.post-80595999465879829842011-08-04T13:23:09.493-07:002011-08-04T13:23:09.493-07:00If you do the following it makes it easier to reus...If you do the following it makes it easier to reuse over and over again.<br /><br />On the TSM server save the following as a script called del_fs<br /><br />def script del_fs desc="Will create a list of filespaces that can be deleted due to being inactive for over 90 days"<br />upd script del_fs "select 'del filespace ' || node_name || ' ' || cast(FILESPACE_ID as char(3)) || ' -"<br />upd script del_fs "type=backup nametype=fsid wait=yes' AS COMMAND from filespaces where -"<br />upd script del_fs "cast((current_timestamp-backup_end)days as decimal)>90 and node_name='$1' "<br /><br />#!/bin/ksh<br />ID=`cat /usr/tivoli/tsm/client/ba/bin/VARS/ADSMID`<br />PA=`cat /usr/tivoli/tsm/client/ba/bin/VARS/ADSMPA`<br />clear<br />echo "Enter the node to process: \c"<br />read NODE<br /><br />dsmadmc -id=xx -pass=xx -dataonly=yes -commadelimited -outfile=./tmp.txt run del_fs $NODE<br /><br />while read LINE<br /> do<br /> dsmadmc -id=xx -pass=xx $LINE<br /> done < tmp.txtChad Smallhttps://www.blogger.com/profile/02637281120881655693noreply@blogger.comtag:blogger.com,1999:blog-13518440.post-82845390372204452812011-08-04T13:15:25.369-07:002011-08-04T13:15:25.369-07:00This comment has been removed by the author.Chad Smallhttps://www.blogger.com/profile/02637281120881655693noreply@blogger.comtag:blogger.com,1999:blog-13518440.post-90971659395619243272011-08-04T12:08:50.485-07:002011-08-04T12:08:50.485-07:00Great! thank you. Once more question, I am actual...Great! thank you. Once more question, I am actually interested in a shell script. So can I assume I can do something like this.<br />1. script name del_fs<br />2. dsmadmc -id=xx -pass=xx "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 and node_name='$1'"<br />3. so then basically I can run ./del_fs NODE1 and it would delete ALL instances of the filespace using FSID #<br /><br />I am intersted in deleting ALL instances of the filespace and the node itself.<br /><br />Thank you so much.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-13518440.post-59462452389444675222011-08-03T14:14:03.725-07:002011-08-03T14:14:03.725-07:00You can pass items to the script using the variabl...You can pass items to the script using the variable option. <br /><br />Example:<br /><br />run del_fs NODE1<br /><br />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 and node_name='$1'<br /><br />COMMAND<br />------------------------------------------------------------<br />del filespace NODE1 37 type=backup nametype=fsid wait=yes<br />del filespace NODE1 9 type=backup nametype=fsid wait=yes<br />del filespace NODE1 36 type=backup nametype=fsid wait=yesChad Smallhttps://www.blogger.com/profile/02637281120881655693noreply@blogger.comtag:blogger.com,1999:blog-13518440.post-2227582493964383082011-08-03T13:52:28.016-07:002011-08-03T13:52:28.016-07:00Chad,
Thanks, I have been looking for something l...Chad,<br /><br />Thanks, I have been looking for something like this. Does your script take input from command line, specifically the host/client name ?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-13518440.post-48846265321795028202011-05-03T09:02:06.566-07:002011-05-03T09:02:06.566-07:00Typically I use this when decommed servers have go...Typically I use this when decommed servers have gone past the stated retention time and we are allowed to delete their data. I've work on some accounts where we had to provide the documentation (actlog records) that the data was removed. So I would run this as a script. I had to provide a Q FILESpace for the node, the script name, the commands it ran, and the resulting actlog info in the ticket closure.Chad Smallhttps://www.blogger.com/profile/02637281120881655693noreply@blogger.comtag:blogger.com,1999:blog-13518440.post-86839704326975779162011-05-02T21:04:50.743-07:002011-05-02T21:04:50.743-07:00Chad,
Can you give me a scenario where you would ...Chad,<br /><br />Can you give me a scenario where you would have a need to clean up filespaces like this? Some sort of database backups? I haven't (yet) run across a need to do something like this, so I'm curious.<br /><br />Thanks!<br /><br />TomTom Kylehttp://www.lanigera.com/wordpressnoreply@blogger.com