setting up deljobhst as recurring job

Sort:
You are not authorized to post a reply.
Author
Messages
DougAB
Advanced Member
Posts: 28
Advanced Member
    The Lawson Jobs & Reports manual states, "You can also define deljobhst as a user form ID and run it as a recurring job."

    I'm not sure I follow this.  I'm trying to set up the deljobhst to run every night but don't see how I can set it up as a Lawson job.

    Any assistance is appreciated.

    Thanks.
    John Henley
    Senior Member
    Posts: 3348
    Senior Member
      Are you familiar with recdef?
      Alternatively you can use cron on unix or scheduled tasking windows.
      Thanks for using the LawsonGuru.com forums!
      John
      Greg Moeller
      Veteran Member
      Posts: 1498
      Veteran Member
        Go into LID as the user you want to run the job as, create a job via jobdef, called whatever you want.
        In the 'Form ID' field hit F4 - Switch the 'Type' field to be 'Universe'
        Move to the 'Category' field and hit F4b again. Select 'JOBSCHD' and select 'deljobhst' from there.
        Proceed to set up the job as normal.
        Once this is done, you can schedule it from recdef.
        DougAB
        Advanced Member
        Posts: 28
        Advanced Member
          Thanks Greg and Julie. I have my solution.
          JimY
          Veteran Member
          Posts: 510
          Veteran Member
            Hi DougAB,
            I created a perl script to set the to date on the "to" date of the deljobhst command. I then use cron to execute it.
             #!/usr/bin/perl
            # Two arguments are passed to this script through the command line.
            # They are the number of days to go back and the options for the
            # deljobhst command.  For example if you enter a 2 then this will
            # delete report files with a date that is 2 days less than the current
            # date.  The from date is hard coded.
            # This script does not do any verification.
            # ***************************************************************************
            # This script was created by Jim Young for use with the Lawson system.
            # Depending on the options passed this script will delete job
            # history listings, completed history listings and report file listings.
            # Check the Lawson documentation for the command syntax and options.
            # ***************************************************************************
            $myseconds=time + ((@ARGV[0] * 86400) * -1);
            ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($myseconds);
            $year=$year+1900;
            $nyear=substr($year,2,2); # Grab the last two digits of the year
            $mon=$mon+1;
            if($mon<10) {$mon="0$mon";}
            if($mday<10) {$mday="0$mday";}
            # Format the date in MMDDYY.
            $mydate="$mon$mday$nyear";
            $options=lc(@ARGV[1]);
             # Change to lower case system("deljobhst -$options -f010107 $mydate");

            Below are the commands in cron.
            Completed and job history:
             . cv lawprod
            perl /usr/local/bin/law_deljobhst 2 cj > /lsf1/hurdata/deljobhst_cj.log
            

            Reports:
            . cv lawprod 
            perl /usr/local/bin/law_deljobhst 14 r > /lsf1/hurdata/deljobhst_r.log 

            GlendaR
            Basic Member
            Posts: 7
            Basic Member

               

              Has anyone experienced deadlock when a job starts to run while 'deljobhst' is executing?  Infor's recommendation is to run 'deljobhst' while there are no other jobs running.   I'd like to find out if anyone else had the deadlock issue and how you get around it, if we cannot stop other jobs to run.    Any feedback would be appreciated.   Thanks!

              Kwane McNeal
              Veteran Member
              Posts: 479
              Veteran Member
                Glenda,
                This is a six year old thread, so you may not get a lot of answers.
                But yes, the deadlock issue has been an on/off again issue for sometime.

                There is no way around it that I’m aware of, so Infor’s recommendation is best.

                Also, I would schedule it through the system task scheduler (e.g. cron), instead of in LSF’s jobscheduler itself.
                GlendaR
                Basic Member
                Posts: 7
                Basic Member
                  Thanks Kwane!
                  Greg Moeller
                  Veteran Member
                  Posts: 1498
                  Veteran Member
                    Glenda:
                    We have our DELJOBHST set up in the LSF jobscheduler to run when the system is quiet... We've negotiated a period of time with HR, Materials, Finance, etc where no jobs are being run. This allows us to do our monthly reboots of the servers and the deljobhst.
                    You are not authorized to post a reply.