Scenario: you set a Cyclic Backup script to make full and differential backups, then discover that new full backups are created instead of differentials
This may happen if the fileexist
function fails to verify the existence of the base archive file that does, in fact, exist. Use the following workaround.
sub_FindLatestImage
. It should be from line 780 to line 837, ending with ENDCALL
.\program\
, and run in the terminal through scripts.exe
.In the terminal output, one of the first lines should read Base image found, and differential backups should now be created successfully. You can then incorporate these changes to the base script (cyclbckp.psl
in \scripts\
). Back the script up in case you reinstall the program later.
sub_FindLatestImage: // Read params and initialize variables
SET STRING Dir4 = POPSTR
SET VALUE aDate2 = 0
SET VALUE aTime2 = 0
SET VALUE lDate = 0
SET VALUE lTime = 0
SET STRING F3 = ""
SET STRING aRes4 = ""
// scan images
XFIND
OPTIONS
RESULT = F3
RECURSIVE = FILES FIRST
RECURSIVE LEVEL = 1
START = string(Dir4)
MASK = string(x_ImageDirMask)
SEARCH = WIDE
FILES = OFF
DIRECTORIES = ON
ENDOPTIONS
BEGIN // extract YYYYMMMDD from file-name
PUSHSTR(SUBSTRING(string(F3),0,8))
CALL sub_StrToInt
SET VALUE aDate2 = POPNUM
// extract HHMMSS from file-name
PUSHSTR( SUBSTRING(string(F3),9,6) )
CALL sub_StrToInt
SET VALUE aTime2 = POPNUM
// search for oldest date+time
IF ( (value(aDate2)>value(lDate))
OR( (value(aDate2)==value(lDate))
AND (value(aTime2) >value(lTime))))
THEN
SET VALUE lDate = value(aDate2)
SET VALUE lTime = value(aTime2)
SET STRING aRes4 = string(F3)
ENDIF
ENDXFIND
IF ((value(lDate)+value(lTime))<=0) THEN // check if any valid dir-name was observed
PUSHSTR("")
ENDCALL
ENDIF
SET STRING file_name = string(g_ImageName) // Expected arhive name
PRINT "Expected archive name = " + string(file_name)
PRINT ""
SET STRING Dir4 = string(Dir4) +"/"+ string(aRes4)
SET STRING aRes4 = string(Dir4) +"/"+ string(g_ImageName)
PRINT "Base image path aRes4 = " + string(aRes4)
PRINT ""
SET VALUE file_found = 0
// Verify existence of base archive
XFIND
OPTIONS
RESULT = F3
RECURSIVE = FILES FIRST
RECURSIVE LEVEL = 2
START = string(Dir4)
MASK = string(file_name)
SEARCH = WIDE
FILES = ON
DIRECTORIES = OFF
ENDOPTIONS
BEGIN
PRINT "Base image found"
PRINT ""
SET VALUE file_found = 1
ENDXFIND
IF (value(file_found) == 0) THEN
SET STRING aRes4 = ""
ENDIF
// return image dir-name
PUSHSTR(string(aRes4))
ENDCALL
Backup & Recovery, Hard Disk Manager™ for Windows, Products for Windows
Tags: backup, issue