PRMClient Script

Discussion in 'Paragon Drive Backup Product Line' started by Markus1234, Nov 19, 2009.

Thread Status:
Not open for further replies.
  1. Markus1234

    Markus1234 Registered Member

    Joined:
    Nov 19, 2009
    Posts:
    2
    Hi there!
    We do our images with the Paragon Remote Client. We use the "Full_SP_to_Net.psl" Script.

    First of all...is there an editor or a program that checks the scripts for failures or something? Because I can't script at the moment and I can't test it.

    I want to store 2 Versions of images. I want the program to look if there is already a "string(ImgStorage) + "/system/system.pbf"" there, then it should rename the directory to "string(ImgStorage) + "/system2/system.pbf"".

    If there is already a "..system2/.." it should overwrite it.
    the latest image should be stored in "string(ImgStorage) + "/system/system.pbf""

    can you help me please :)

    The script is here:
    Code:
    set value disknum = 0
    
    // Turn off confirmation
    confirm off
    
    set string ImgStorage = getenv("PRMStorage")
    
    // -------begin analyze HDD structure------------
    set value counter = -1
    set value syspart = -1
    
    do
    	set value counter = value(counter)+1
    	
    	if (boot(value(disknum),value(counter)))
    	then
    		set value syspart = value(counter)
    	endif
    
    while (exist(value(disknum),value(counter)+1))
    
    
    // Backup
    img = string(ImgStorage) + "/system/system.pbf"
    select disk value(disknum)
    select partition value(syspart)
    options
    	cmp = 10
    	mfs = 2000 * 1024
    	notempfiles
    	nosignature
    	autonames
    	hotbackup lockimpossible
    	tempdrive C
    store
    
    // Check for errors
    call check_error
    
    // Apply all scheduled operations
    apply all
    
    // Check for errors
    call check_error
    
    // Exiting
    exit(0)
    
    // Function for checking error
    check_error:
    	if (errorcode(1) != 0)
    	then
    		print "Some error occured: "
    		strerror(errorcode(1))
    		print ""
    		print "Exiting"
    		print ""
    		exit(errorcode(1))
    	endif
    endcall
    
     
  2. Paragon_Tommy

    Paragon_Tommy Paragon Moderator

    Joined:
    Aug 10, 2009
    Posts:
    918
    Hello Markus1234,

    Basically you want to retain 2 copies of the backup at all given time.

    There's a couple of easier ways to do that.

    The cyclic backup will let you specify how many backups you want to retain. Once you max out that number, the next backup overwrites the oldest image. The limitation of cyclic backup is it can only be done to one partition at a time.

    The other method is to setup two independent backups alternating and each time it runs, it will overwrite the its previous image.
     
  3. Markus1234

    Markus1234 Registered Member

    Joined:
    Nov 19, 2009
    Posts:
    2
    Hello Tommy,
    thanks for your reply!
    Hmm, that is probably a way to do it.
    But I think I have found a way to run my modified script.

    To the script I have to say: I wanted to delete the "Version2dir" but it doesn't work. I don't know why. The program has not deleted the directory. I tried it with an empty one, but it doesn't work. That's the reason why I rename it in "Temp" and then again in "system" ;)
    here is the code:

    Code:
    set value disknum = 0
    
    // Turn off confirmation
    confirm off
    
    set string ImgStorage = getenv("PRMStorage")
    
    // Die Variablen für die Verzeichnisse
    SET STRING Version1 = string(ImgStorage)+"/system/system.pbf"
    SET STRING Version2 = string(ImgStorage)+"/system2/system.pbf"
    SET STRING TEMP = string(ImgStorage)+"/Temp/system.pbf"
    SET STRING Version1dir = string(ImgStorage)+"/system"
    SET STRING Version2dir = string(ImgStorage)+"/system2"
    SET STRING TEMPdir = string(ImgStorage)+"/Temp"
    
    // Abfrage ob es Datei schon gibt. Wenn ja, neues Verzeichnis
    
    IF (FILEEXIST(string(Version2)))	THEN
    		FILERENAME(string(Version2dir),string(TEMPdir))
    ENDIF
    
    
    IF (FILEEXIST(string(Version1))) THEN
    		FILERENAME(string(Version1dir),string(Version2dir))
    ENDIF
    
    
    IF (FILEEXIST(string(TEMP))) THEN
    		FILERENAME(string(TEMPdir),string(Version1dir))
    ENDIF
    
    
    
    
    // -------begin analyze HDD structure------------
    set value counter = -1
    set value syspart = -1
    
    do
    	set value counter = value(counter)+1
    	
    	if (boot(value(disknum),value(counter)))
    	then
    		set value syspart = value(counter)
    	endif
    
    while (exist(value(disknum),value(counter)+1))
    
    
    // Backup
    
    img = string(ImgStorage) + "/system/system.pbf"
    select disk value(disknum)
    select partition value(syspart)
    options
    	cmp = 10
    	mfs = 2000 * 1024
    	notempfiles
    	nosignature
    	autonames
    	hotbackup lockimpossible
    	tempdrive C
    store
    
    // Check for errors
    call check_error
    
    // Apply all scheduled operations
    apply all
    
    // Check for errors
    call check_error
    
    // Exiting
    exit(0)
    
    // Function for checking error
    check_error:
    	if (errorcode(1) != 0)
    	then
    		print "Some error occured: "
    		strerror(errorcode(1))
    		print ""
    		print "Exiting"
    		print ""
    		exit(errorcode(1))
    	endif
    endcall
    
     
  4. Paragon_Tommy

    Paragon_Tommy Paragon Moderator

    Joined:
    Aug 10, 2009
    Posts:
    918
    I'm glad to hear you found a way. Feel free to use the script manual link in my signature for your reference.
     
Loading...
Thread Status:
Not open for further replies.