ADSM-L

Re: Archiving does not delete directories ???

2004-03-24 11:29:12
Subject: Re: Archiving does not delete directories ???
From: "Khan, Khalid B." <kkhan AT ATCLLC DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Wed, 24 Mar 2004 10:28:37 -0600
Andy,

Thank you very much for the explanation, your point is well take. Also
thank you for the script.

I suppose I can create a schedule and use COMMAND as the ACTION for the
schedule and use your script to run it. That should work, correct?

Khalid


-----Original Message-----
From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] On Behalf Of
Andrew Raibeck
Sent: Wednesday, March 24, 2004 9:44 AM
To: ADSM-L AT VM.MARIST DOT EDU
Subject: Re: Archiving does not delete directories ???

The -DELETEFILES option was originally designed to operate on files
only,
not directories (as was the original implementation of ARCHIVE). The
-DELETEFILES option is not designed to differentiate between archive of
full trees and archives of partial trees. For example, in which cases
should TSM delete the entire directory structure?

   dsmc archive c:\mydir\*.txt -deletefiles
   dsmc archive c:\mydir\ -deletefiles

What if there are files excluded from the archive via EXCLUDE statements
in your client options file, or a file otherwise fails to be archived?
Should TSM still delete the entire directory structure?

What if there are subdirectories of c:\mydir, but -subdir=yes is not
specified? Should TSM still delete the entire directory structure?

In principle, what you ask is not necessarily unreasonable. It's just
not
something that TSM is set up for (and it is not trivial, as the above
questions suggest). Consider opening a requirement if this function is
valuable to you. If you do open a requirement, it would help if you
could
elaborate on how you think the function should behave in scenarios such
as
those I describe above. That is, under what circumstances should or
should
not TSM presume to delete the directory tree?

In the mean time, you can simulate this function for yourself if you
wish.
For example, the following Windows script can do what you ask (note that
this is only an example, use at your own risk).

REM BEGIN SCRIPT
   @echo off
   if {%1} == {} goto :USAGE

   pushd c:\tsm\baclient

   dsmc archive %* -deletefiles

   if not %errorlevel% equ 0 (
      echo TSM archive function ended with return code %errorlevel%.
      echo Directories will not be deleted.
      goto :END
   )

:TOP
   if {%1} == {} goto :END
   echo.
   echo Deleting directory %1
   rd /s /q %1
   shift
   goto :TOP

:USAGE
   echo Usage: ARCHDEL dir1\ [dir2\ ...]
   echo.
   echo        Example: archdel c:\mydir\
   echo        Example: archdel c:\mydir\ e:\yourdir\ f:\herdir\
   echo        Example: archdel "c:\my directory\ " t:\junk\
   echo.
   echo        Note: When enclosing a directory in quotes,
   echo              put a blank space between the ending
   echo              '\' and the ending quote.

:END
   popd
REM END SCRIPT

Andy Raibeck
IBM Software Group
Tivoli Storage Manager Client Development
Internal Notes e-mail: Andrew Raibeck/Tucson/IBM@IBMUS
Internet e-mail: storman AT us.ibm DOT com

The only dumb question is the one that goes unasked.
The command line is your friend.
"Good enough" is the enemy of excellence.



"Khan, Khalid B." <kkhan AT ATCLLC DOT COM>
Sent by: "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
03/24/2004 08:00
Please respond to
"ADSM: Dist Stor Manager"


To
ADSM-L AT VM.MARIST DOT EDU
cc

Subject
Archiving does not delete directories ???






Can someone please explain to me why TSM client does not delete the
directory structure of the archived files? I am using the "deletefiles"
option, but the client leaves the directories on the file system and
successfully deletes the files within those directories.

Is there something I can do to delete the directories together with the
files? Please advise.

Thank you,

Khalid Khan
ATC

<Prev in Thread] Current Thread [Next in Thread>