new name for old file
############################################################### /*--------------------------------------------------------*/ Variables: USERNAME ="SYSTEM"; /* user name */ USERPASSWORD ="MANAGER"; /* user password */ ARCDEVICE ="./"; /* for new files */ ARCFNAME =""; /* new name for old file */ CHKSUF = ".lhb"; /* suffix for checkpoint file */ /*--------------------------------------------------------*/
Rights: Everyday ( time = '15:35' ) { backup ( "s -u "+USERNAME+"/"+USERPASSWORD+" -f "+ARCDEVICE+ "db.lhb"+" -qc DF -inc" );
logprint ( CTIMESTAMP() + " --- File " + "db" + CHKSUF + " updated.\n" );
Exception: /* for everyday */ print ( "Error=" + TOSTR(CERROR) + " , LinError=" + TOSTR(LINERROR) + " , SysError=" + TOSTR(SYSERROR) );
logprint ( CTIMESTAMP() + " --- Error=" + TOSTR(CERROR) + " , LinError=" + TOSTR(LINERROR) + " , SysError=" + TOSTR(SYSERROR) );
stop; } /* Everyday */ /*--------------------------------------------------------*/
Special: before /* just after the start */ { backup ( "s -u "+USERNAME+"/"+USERPASSWORD +" -f "+ARCDEVICE+"db.lhb"+ " -qc DF -startinc" );
logprint ( CTIMESTAMP() + " --- File " + "db" + CHKSUF + " created.\n" );
} after /* after stop or Ctrl-C */ { print ( " --- Stop backup system" );
if ( CERROR != 0 ) logprint ( CTIMESTAMP() + " --- Error present: " + TOSTR(CERROR) );
logprint ( CTIMESTAMP() + " --- Stop backup system\n" );
} iferr /* global */ { print ( "Error=" + TOSTR(CERROR) + " , LinError=" + TOSTR(LINERROR) + " , SysError=" + TOSTR(SYSERROR) );
logprint ( CTIMESTAMP() + " --- Error=" + TOSTR(CERROR) + " , LinError=" + TOSTR(LINERROR) + " , SysError=" + TOSTR(SYSERROR) );
stop; }
/*--------------------------------------------------------*/ ###############################################################
Более полное описание языка bsl можно найти в документации на СУБД ЛИНТЕР, а описание программы cron и файла в документации на операционную систему.