REM ************************************************************************* REM PROGRAM NAME: lawson_daily.cmd REM AUTHOR: Russ Sprague (rsprague@feldinc.com) REM DESCRIPTION: Daily Lawson Maintenance (Windows Scheduled Job) REM USAGE: Schedule with AT, but needs to run as FEI\LAWSON REM DATE: 2003-02-27 - Created REM 2003-05-15 - Added jobinteg [JE] REM 2003-07-29 - Added usermap [JE] REM 2003-11-16 - Added secdump_all.cmd [JE] REM 2004-03-02 - Modified for move to single server [JE] REM 2004-03-18 - Added cleanup of workfiles [JE] REM 2004-03-25 - secdump_all.cmd needs to stand alone[JE] REM 2004-03-26 - secdump_all does not need to stand alone REM it needs the fully qualified path [JE] REM 2004-03-30 - Run job to correct sql obj ownrship [JE] REM 2004-04-14 - Moved the date env variable to it's own REM section [JE] REM 2004-04-14 - Added the backup of the GEN database [JE] REM 2004-04-14 - secdump_all.cmd is running on it's own REM once and for all [JE] REM 2004-04-22 - Added -d and -n before listusermap REM 2004-04-22 - Added registry backup [JE] REM 2004-04-23 - Replaced hardcoded path with %GENDIR% [JE] REM 2004-04-23 - Registry backup keeps 30 day now [JE] REM 2004-05-16 - Added backup of LOGAN db [JE] REM 2004-05-27 - Added table_prefixes.txt [JE] REM 2004-08-06 - Cleanup of %lawdir%/system/joblog [JE] REM 2005-07-11 - Changed to lawson_daily.sql [JE] REM 2005-07-11 - Added -f to gzip option [JE] REM 2005-07-28 - Steve wuz here REM ************************************************************************* @ECHO ON REM ************************************************************************* REM Delete Job histories for jobs waiting with invalid parameters.. REM ************************************************************************* deljobhst -w 'curdate' - 1 jobinteg -d REM ************************************************************************* REM Give users a usermap to look at - [JE] 2003-07-29 REM ************************************************************************* %GENDIR%\bin\listusermap -d %GENDIR%\bin\listusermap -n %GENDIR%\bin\listusermap | sort > D:\LAWWEB\IOSRE\lawson\usermap.txt REM ************************************************************************* REM Give users a listing of the table prefixes - [JE] 2004-05-27 REM ************************************************************************* rngdbdump -nt gen filedef -f filename prefix systemcode -v ProductLine=PROD > D:\LAWWEB\IOSRE\lawson\table_prefixes.txt REM ************************************************************************* REM Fix SQL Object Ownership - [JE] 2004-03-30 REM Changed script name to lawson_daily.cmd and added SQL Server logs [JE] REM ************************************************************************* REM isql -U lawson -P password -S lawson1 -i d:\law\apps\system\change_table_owner.sql isql -U lawson -P password -S lawson1 -i d:\law\apps\system\lawson_daily.sql REM ************************************************************************* REM Set the date format variable - [JE] 2004-03-04 REM ************************************************************************* set format=ymd set sep=- for /f "tokens=2,3,4 delims=/ " %%a in ('date /t') do set zdate=%%c%sep%%%a%sep%%%b REM ************************************************************************* REM Backup Production Database - [JE] 2004-03-04 REM ************************************************************************* d:\mks\mksnt\find d:\backup\database\*.gz -mtime +30 -print -exec rm -r {} ; %GENDIR%\bin\expsysdb -s prod d:\backup\database\%zdate%_prod.dmp gzip -f d:\backup\database\%zdate%_prod.dmp REM ************************************************************************* REM Backup LOGAN Database - [JE] 2004-05-16 REM ************************************************************************* d:\mks\mksnt\find d:\backup\logan\*.gz -mtime +30 -print -exec rm -r {} ; %GENDIR%\bin\expsysdb -s logan d:\backup\logan\%zdate%_logan.dmp gzip -f d:\backup\logan\%zdate%_logan.dmp REM ************************************************************************* REM Backup the registry - [JE] 2004-04-22 REM ************************************************************************* d:\mks\mksnt\find d:\backup\registry\*.reg -mtime +30 -print -exec rm -r {} ; c:\winnt\system32\reg export "hklm\software\lawson software\lawson insight environment\global" D:\Backup\Registry\%zdate%_lawson.reg REM ************************************************************************* REM Cleanup old COBOL and XML workfiles - [JE] 2004-03-18 REM ************************************************************************* d:\mks\mksnt\find d:\law\apps\prod\work -mtime +30 -print -exec rm -r {} ; d:\mks\mksnt\find d:\law\apps\system\joblog -mtime +30 -print -exec rm -r {} ; d:\mks\mksnt\find c:\temp -mtime +30 -print -exec rm -r {} ; d:\mks\mksnt\find d:\temp -mtime +30 -print -exec rm -r {} ; REM ************************************************************************* REM Backup GEN Database - [JE] 2004-04-14 REM ************************************************************************* d:\mks\mksnt\find d:\backup\gen\*.gz -mtime +30 -print -exec rm -r {} ; rm -rf d:\backup\temp\* xcopy /e /c d:\law\db d:\backup\temp tar cvfz d:\backup\gen\%zdate%_gen.tar.gz d:\backup\temp\* rm -rf d:\backup\temp\* REM ************************************************************************* REM Backup Production Security Definitions - [JE] 2003-11-16 REM ************************************************************************* REM d:\law\apps\system\secdump_all.cmd