[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

368.0. "Suggestions for a cleanup script?" by CGOOA::IUS (Donald V. Ius - DTN: 638-6927) Tue Mar 31 1992 00:18

    Hi,
    
    I will be going to a customers site this week to write a script that
    will search through all ALL-IN-1 user file cabinets and look for and
    delete all documents from a particular folder or source (I'm not sure
    which).
    
    Since I don't have any documentation nor do I have access to an
    ALL-IN-1 system to practice on, I thought I'd inquire in this
    conference to see if anybody can make some suggestions.
    
    I used to do a fair bit with ALL-IN-1 several years ago, but haven't
    done a thing with it for about three years, until just recently.  I
    know a lot has changed with it.  I seem to recall that there was
    already some house cleaning scripts provided with ALL-IN-1 that did
    this sort of thing, like emptying all the waste baskets.  Would it be
    safe for me to take a copy of that script and modify it to suit the
    present requirements?
    
    Anyways, any helpful suggestions would be appreciated.  The less time
    it takes me to do this work for the customer, the more appreciative
    they will be.
    
    Thanks in advance...
    
    /Don I.
T.RTitleUserPersonal
Name
DateLines
368.1A stupid script from me (what else ;')HYPERS::VICKERSIf it helps a customer, DO ITTue Mar 31 1992 01:1532
    Below is a script which I use to blow away old documents on my ALL-IN-1
    account. It is a really crude and poor imitiation of the JAN_CLEAN tool
    which used to be in ASSETS.
    
    It requires that the user enter the folder name and purge date on a
    form called NBSDATE.  This trivial form loads the $BLOW_FOLDER and
    $BLOW_NBSDATE symbols with the folder name and NBS date.
    
    I am sure that others can give you better tools so this will serve as a
    mere starter:
    
    ! Blow_Em.SCP           Blow away the old documents
    !
            FORM NBSDATE
            .IF OA$FORM_DISPOSE NE 2 THEN .EXIT
    !
            DECIMAL I
            DISPLAY Working ...
            FORCE
            GET #I = 0
            FOR CAB$ WITH .FOLDER == $BLOW_FOLDER AND -
              .MODIFIED_NBS:8 LT $BLOW_NBSDATE DO -
             GET #DOCKEY = .FOLDER:30 .DOCNUM\\-
             CABINET DELETE_DOCUMENT #DOCKEY\\-
             .IF OA$STATUS THEN COMPUTE #I = #I + 1
    !
            GET OA$DISPLAY = #I ' documents deleted'
    !
    ! [End]
    
    Have fun,
    don
368.2"Take a look at note 317, might help"BODRUM::YEGENTue Mar 31 1992 11:009
    I thought that you might take a look at note 317 in which I managed to
    enter to the filecabinets of the users and change two specific
    chracters in all documents (documents, attachments, mails) into two
    other specific characters. This might give you some programming ideas,
    too.
    
    Best regards,
    
    TANSU
368.3doesn't run in batch modeCGOOA::IUSDonald V. Ius - DTN: 638-6927Fri Apr 03 1992 22:1284
    Hi,
    
    Thanks for the helpful suggestions.  I've been to the customers site
    and have successfully created a set of scripts that do what we want
    while running interactively, but the customer wants of course to run
    this procedure at night in batch mode.
    
    I tried to produce a script & command procedure that would do as
    requested, but I find that it works fine when I run it from DCL in a
    command procedure, but nothing happens when running it as a batch job. 
    Ths job starts up just fine, but then it seems to just sit there.
    
    The following are samples of the procedures I am using.  If anyone can
    spot what I am doing wrong, I'd sure appreciate your help.
    
    Thanks again...
    
    
    - Start_cleanup.com - First command procedure calleds from DCL or
    submitted to batch.
    
    $ allin1/noinit -
            /override -
            /reenter -
            /user=manager
    oa$ini_init
    script oauser:start_cleanup
    .exit
    $ exit
    
    - Start_cleanup.scp - invoked from command procedure above.
    
    .function do oauser:cleanup
    
    - Cleanup.scp - called from the above script.
    
    .LABEL Start
    	GET #DATE_NBD="1992010100000000"
    	GET OA$DCL="OPEN/WRITE OUTLOG CLEANUP.LOG"
    	GET #TEXT = "Beginning Cleanup procedure at " OA$DATE_FULL
    	GET OA$DCL="WRITE OUTLOG " """" #TEXT """"
    	FOR PROFIL DO GET #NEWUSER = .USER\\-
    		GET OA$FUNCTION="NEWDIR " #NEWUSER\\-
    		GET #TEXT = "Checking documents for user: " #NEWUSER\\-
    		GET OA$DCL="WRITE SYS$OUTPUT " """" #TEXT """"\\-
    		GET OA$DCL="WRITE OUTLOG " """" #TEXT """"\\-
    		DO SYS$SYSDEVICE:[ALLIN1.MGR]CHECK_FOLDER
    !end for
    	GET OA$FUNCTION="NEWDIR"
    	GET OA$DCL="CLOSE OUTLOG"
    .EXIT
    
    - Check_folder.scp - Called from the above script.
    
    .LABEL Start
    	CABINET OPEN
    	DECIMAL I
    	GET #I = 0
    	GET #FOLDER = "READ"
    	CABINET SELECT #FOLDER,,,#DOCKEY
    	.IF OA$STATUS == 0 THEN No_More
    
    .LABEL NEXT_Doc1
    	.IF OA$CURDOC_MODIFIED_NBS LTS #DATE_NBD THEN .GOTO DEL_Doc1
    	CABINET NEXT_DOCUMENT #FOLDER, #DOCKEY
    	.IF OA$STATUS == 1 THEN .GOTO NEXT_Doc1
    	.GOTO No_More
    
    .LABEL DEL_Doc1
    	GET #FILENAME = OA$CURDOC_FILENAME
    	GET $TITLE = OA$CURDOC_TITLE !DCL symbol needed
    	COMMAND SYS$SYSDEVICE:[ALLIN1.MGR]NO_QUOTE !Strip any " from title
    	GET #TEXT='Title : $TITLE ' Filename: ' #FILENAME
    	GET OA$DCL="WRITE SYS$OUTPUT " """" #TEXT """"
    	GET OA$DCL="WRITE OUTLOG " """" #TEXT """"
    	CABINET DELETE_DOCUMENT #DOCKEY
    	.IF OA$STATUS == 1 THEN COMPUTE #I = #I + 1
    	CABINET NEXT_DOCUMENT #FOLDER, #DOCKEY
    	.IF OA$STATUS == 1 THEN .GOTO NEXT_Doc1
    	.GOTO No_More
    
    .LABEL No_More
    	GET OA$DCL-"WRITE SYS$OUTPUT " """" #I """" " documents deleted"
    	.EXIT
368.4Go directly to DO CLEANUP, do not collect $200BUFFER::VICKERSIf it helps a customer, DO ITFri Apr 03 1992 22:4612
    I'm not sure whether the SCRIPT mode script will be taken from the
    stack so I suggest just executing the DO script.  I suggest changing
    the line:

    script oauser:start_cleanup

    line to:

    DO oauser:cleanup

    I hope this gets you somewhere,
    don
368.5Just in case...HOTAIR::MADDOXDIGITAL AlienFri Apr 03 1992 23:024
If Don's suggestion doesn't fix your problem (whom am I kidding?) then I would
suggest that you include a log file on a job that you start, let run for
awhile and then kill.  It might provide a clue as the whether it's in a loop
or hung up on a command, etc.
368.6a little more...CGOOA::IUSDonald V. Ius - DTN: 638-6927Tue Apr 07 1992 01:2026
>If Don's suggestion doesn't fix your problem (whom am I kidding?) then I would
>suggest that you include a log file on a job that you start, let run for
>awhile and then kill.  It might provide a clue as the whether it's in a loop
>or hung up on a command, etc.
    
    I'm sorry to have to ask this, but how do I "... include a log file
    ..."?  I submitted this to batch with a batch log file but nothing
    beyond the first lines of the command procedure were recorded in 12
    hours.
    
    I imagine that is not the log file you are referring to.
    
    Also, I originally tried the DO script directly from the command
    procedure but that didn't work either.  I read somewhere that I may
    need to call OA$SUB_OPEN first.  Could this be the problem?  The
    interesting thing is that the output log file that I am trying to
    generate does get created, however the only thing in it is the first
    statement that indicates the cleanup procedure was begun at a certain
    date.  This seems odd to me that it could get that far but no farther.
    
    As always, any help is greatfully appreciated.
    
    /Don I.
    
    P.S.  The customer is running ALL-IN-1 V2.3.  Could this make a
    difference?
368.7Try tracing from an interactive session57826::VICKERSIf it helps a customer, DO ITTue Apr 07 1992 04:2119
    V2.3 shouldn't be an issue in this regard.

    You might want to improve the Record Selection Expression in your FOR
    so that you skip over the distribution lists but I doubt that this will
    correct the rather strange effect you are seeing:

    	FOR PROFIL WITH .MAIDES NES "MAIL-LIST" DO GET #NEWUSER = .USER\\-

    It's not clear from your description as to whether the code is looping
    or freezing.  I am guessing that it may be looping and suggest that you
    turn on tracing of SCRIPT, MESS, and SYMBOL via the GOLD % keys and
    have the output go to the screen.  Interactively invoke your script and
    see if you can see anything exciting and/or interesting occurring.

    You might wish to change the trace to go to A1TRACE.LOG if there is a
    great deal of information.

    Let us know what you discover,
    don
368.8it works interactively...CGOOA::IUSDonald V. Ius - DTN: 638-6927Tue Apr 07 1992 18:5513
    Thanks for the suggestions,
    
    When I run this script interactively it works just fine.  It is only
    when this is done in "batch" mode that it doesn't work.  It appears
    that it may be looping while waiting for something else to happen. 
    Unfortunately, I can't look at this right now as everything is at the
    customerr site and I don't have immediate access to a system here that
    I can test with.  I'll look around to see if I can do some more testing
    locally then get you more information.
    
    Thanks,
    
    /Don I.
368.9Nits and a suggestionMDCRAB::HOWARDBen. It should do what people expect it to doWed Apr 08 1992 23:2428
    I do notice two things which might or might not be relevant:
    
    1.      $ allin1/noinit -
            /override -
            /reenter -
    
    This might indicate that some is already using the account.  ALL-IN-1
    doesn't know what to do in that case, which is why /NOREENTER is the
    default.
    
    2.      	.IF OA$STATUS == 0 THEN No_More
    
    Missing .GOTO
    
    You might want to put in some bookmarks which will tell you how far it
    is getting, e.g.,:
    
    .LABEL Start
    DISPLAY Step 1
    FORCE
    	GET #DATE_NBD="1992010100000000"
    
    This should force "Step 1" to appear in the .LOG file for the job. 
    Incidentally, you could do the WRITE stuff with TEXT_FILE without using
    the sub-process.  The syntax is practically the same as DCL.
    
    Ben