Page 1 of 1

Backup Process

Posted: Thu Dec 03, 2020 9:13 pm
by samiamsz
Hey guys, I have the following code for creating zip folders(data,applogs,etc) in the zip folder
I want it to create zip folders with the timestamp
The commented line #ExecuteCommand( strBATCall, 1 );
creates the zip folder succesfully
the uncommented executecommand runs but does not create anything,

my folder path looks like this----> 'E:\TM1 Server\BBI\Config\CleanUp.bat '

the ascii output outputs----> "E:\TM1 Server\BBI\Config\CleanUp.bat E:\TM1 Server\BBI\DATA\ 20201203155539 3 3 "

the code

sProcName = GETPROCESSNAME();
cubGlobal = 'SysControl';

strTimeStamp = ' ' | TIMST (NOW, '\Y\m\d\h\i\s' ) | ' ';

strPath = CELLGETS('SysControl', 'Log Path', 'String');
sLogFile = strPath | sProcName | strTimeStamp | '.Log';

strConfigPath = TRIM(CELLGETS(cubGlobal, 'Config Directory', 'String'));
strServerPath = TRIM(CELLGETS(cubGlobal, 'Server Data Directory', 'String'));


strBATCall= strConfigPath | 'CleanUp.bat ';
strDataDir= ' ' | strServerPath | ' ';

strLogDays=' 3 ';
strZipDays=' 3 ';

ASCIIOUTPUT( sLogfile, strBATCall | strDataDir | strTimeStamp | strLogDays | strZipDays ) ;
#ExecuteCommand( strBATCall | strDataDir | strTimeStamp | strLogDays | strZipDays, 1 ) ;

ExecuteCommand( strBATCall | strDataDir | strTimeStamp | strLogDays | strZipDays, 1 ) ;

#ExecuteCommand( strBATCall, 1 );

Re: Backup Process

Posted: Fri Dec 04, 2020 5:15 am
by gtonkin
You could try outputting from the batch file to some logs files to see what is happening e.g.

Code: Select all

ExecuteCommand( strBATCall | strDataDir | strTimeStamp | strLogDays | strZipDays | ' >CleanUp.log 2>CleanUpError.log', 1 ) ;
Those logs will obviously be in your data folder unless you change to log elsewhere.

I also tend to start my commands with CMD /C e.g. 'CMD /C E:\TM1 Server\BBI\Config\CleanUp.bat...'

Would also help if you can share the code in the batch file.