#!/bin/bash
@echo off
echo ======================================
echo INICIOU EM %date% ÀS %time%
echo ======================================
echo INICIO: - %date% - %time% > manutencao.txt

     mkdir c:\phl84r2\bases\backup
     copy c:\phl84r2\bases\*.mst c:\phl84r2\bases\backup >> manutencao.txt
     copy c:\phl84r2\bases\*.xrf c:\phl84r2\bases\backup >> manutencao.txt

          retag ../bases/phl_cnf unlock >> manutencao.txt
          mx ../bases/phl_cnf copy=../bases/phl_cnf "proc='d201d202','a201#S#','a202#Em manuten&ccedil;&atilde;o!#" -all now >> manutencao.txt

          mx ../bases/001_cal +control now >> manutencao.txt
          retag ../bases/001_cal unlock >> manutencao.txt
          mxcp ../bases/001_cal create=xcal clean mintag=1 maxtag=999 >> manutencao.txt
          mx xcal create=../bases/001_cal -all now >> manutencao.txt
          del xcal.* >> manutencao.txt
          mx ../bases/001_cal fst=@ uctab=../bases/uctab actab=../bases/actab fullinv=../bases/001_cal -all now >> manutencao.txt
          mx ../bases/001_cal +control now >> manutencao.txt

          mx ../bases/phl_acv +control now >> manutencao.txt
          retag ../bases/phl_acv unlock >> manutencao.txt
          mxcp ../bases/phl_acv create=xacv clean mintag=1 maxtag=999 >> manutencao.txt
          mx xacv create=../bases/phl_acv -all now >> manutencao.txt
          del xacv.* >> manutencao.txt
          mx ../bases/phl_acv fst=@ uctab=../bases/uctab actab=../bases/actab fullinv=../bases/phl_acv -all now >> manutencao.txt
          mx ../bases/phl_acv +control now >> manutencao.txt

          mx ../bases/phl_usr +control now >> manutencao.txt
          retag ../bases/phl_usr unlock >> manutencao.txt
          mxcp ../bases/phl_usr create=xusr clean mintag=700 maxtag=999 >> manutencao.txt
          mx xusr create=../bases/phl_usr -all now >> manutencao.txt
          del xusr.* >> manutencao.txt
          mx ../bases/phl_usr fst=@ uctab=../bases/uctab actab=../bases/actab fullinv=../bases/phl_usr -all now >> manutencao.txt
          mx ../bases/phl_usr +control now >> manutencao.txt
          
          mx ../bases/phl_res +control now >> manutencao.txt
          retag ../bases/phl_res unlock >> manutencao.txt
          mxcp ../bases/phl_res create=xres clean mintag=1 maxtag=999 >> manutencao.txt
          del ../bases/phl_res.mst
          del ../bases/phl_res.xrf
          mx xres append=../bases/phl_res -all now >> manutencao.txt
          del xres.* >> manutencao.txt
          mx ../bases/phl_res fst=@ uctab=../bases/uctab actab=../bases/actab fullinv=../bases/phl_res -all now >> manutencao.txt
          mx ../bases/phl_res +control now >> manutencao.txt
          
          mx ../bases/phl_pen +control now >> manutencao.txt
          retag ../bases/phl_pen unlock >> manutencao.txt
          mxcp ../bases/phl_pen create=xpen clean mintag=1 maxtag=999 >> manutencao.txt
          del ../bases/phl_pen.mst
          del ../bases/phl_pen.xrf
          mx xpen append=../bases/phl_pen -all now >> manutencao.txt
          del xpen.* >> manutencao.txt
          mx ../bases/phl_pen fst=@ uctab=../bases/uctab actab=../bases/actab fullinv=../bases/phl_pen -all now >> manutencao.txt
          mx ../bases/phl_pen +control now >> manutencao.txt
          
          mx ../bases/001_cxa +control now >> manutencao.txt
          retag ../bases/001_cxa unlock >> manutencao.txt
          mxcp ../bases/001_cxa create=xcxa clean mintag=1 maxtag=999 >> manutencao.txt
          mx xcxa create=../bases/001_cxa -all now >> manutencao.txt
          del xcxa.* >> manutencao.txt
          mx ../bases/001_cxa fst=@ uctab=../bases/uctab actab=../bases/actab fullinv=../bases/001_cxa -all now >> manutencao.txt
          mx ../bases/001_cxa +control now >> manutencao.txt
          
          mx ../bases/001_emp +control now >> manutencao.txt
          retag ../bases/001_emp unlock >> manutencao.txt
          mxcp ../bases/001_emp create=xemp clean mintag=900 maxtag=900 >> manutencao.txt
          del ../bases/001_emp.mst
          del ../bases/001_emp.xrf
          mx xemp append=../bases/001_emp -all now >> manutencao.txt
          del xemp.* >> manutencao.txt
          mx ../bases/001_emp fst=@ uctab=../bases/uctab actab=../bases/actab fullinv=../bases/001_emp -all now >> manutencao.txt
          mx ../bases/001_emp +control now >> manutencao.txt

          mx ../bases/001_log +control now >> manutencao.txt
          retag ../bases/001_log unlock >> manutencao.txt
          mxcp ../bases/001_log create=xlog clean mintag=910 maxtag=910 >> manutencao.txt
          mx xlog create=../bases/001_log -all now >> manutencao.txt
          del xlog.* >> manutencao.txt
          mx ../bases/001_log fst=@ uctab=../bases/uctab actab=../bases/actab fullinv=../bases/001_log -all now >> manutencao.txt
          mx ../bases/001_log +control now >> manutencao.txt
          
          mx ../bases/001_tbo +control now >> manutencao.txt
          retag ../bases/001_tbo unlock >> manutencao.txt
          mxcp ../bases/001_tbo create=xtbo clean mintag=800 maxtag=9999 >> manutencao.txt
          mx xtbo create=../bases/001_tbo -all now >> manutencao.txt
          del xtbo.* >> manutencao.txt
          mx ../bases/001_tbo fst=@ uctab=../bases/uctab actab=../bases/actab fullinv=../bases/001_tbo -all now >> manutencao.txt
          mx ../bases/001_tbo +control now >> manutencao.txt

mx ../bases/phl_cnf copy=../bases/phl_cnf "proc='d201d202','a201#N#'" -all now >> manutencao.txt
mx ../bases/phl_cnf fst=@ uctab=../bases/uctab actab=../bases/actab fullinv=../bases/phl_cnf -all now >> manutencao.txt

echo TERMINOU EM %date% ÁS %time%
echo ======================================
echo TERMINOU ÀS: - %date% - %time% >> manutencao.txt
echo Processo concluído!