PDA

View Full Version : Scripting help


ByondF1
September 6th, 2009, 02:44 PM
I am trying to modify the backup script for my nightly backups so that the file names contain the Day of Week. For example:

\\Nas1\FTPData\CW SSR\arc_280509191352995\img_0_280509_191453696_Friday.PBF

instead of:
\\Nas1\FTPData\CW SSR\arc_280509191352995\img_0_280509_191453696_2009_0906.PBF

Also, how can I change the Label = command toward the bottom so the label will have the current date and time of the backup?

Can someone tell me how to modify this so that it will work?

// This file was automatically generated by Paragon script generator
// Time of creation: Thu May 28 12:14:54 2009
// Use Paragon Script Interpretator to run this file

// Settings block
settings
surfacetest off
verify off
copyonetoone off
hddrawprocess off
allow64kcluster off
donothidetarget on
copyinsteadofmove off
bigdrives off
compressionlevel 10
sidafterdisk off
sidafterpartition off
defaultsidchanger on
nodellabel off
timeshift 0
oemcodepage 850
timezone 20
langnumber 17
slavecfg off
notforslave off
enablerestart on
enablevirtualdb on
autoconverttofat32 on
sidparams ""
bootcdiso ".\..\ISO\bootcd.iso"
hotbackup lockimpossible
tempdrive C
endsettings

// Turn off confirmation
confirm off

// Backup
img = "\\Nas1\FTPData\CW SSR\arc_280509191352995\img_0_280509_191453696_$(YEAR)_$(MONTH)$(DAY).PBF"
select disk 0
select partition primary 0
options
cmp = 10
notempfiles
label = "No comment"
autonames
hotbackup lockimpossible
tempdrive C
usevss
store

// Check for errors
call check_error

options
label = "Backed up on 5/28/2009 7:14:31 PM (UTC time)"
store complex

// 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

Thanx.

Paragon_Cisco
September 8th, 2009, 03:00 PM
Hello ByondF1,

If you notice this syntax in your script: "$(YEAR)_$(MONTH)$(DAY)"
It puts a date stamp in your file name. If you replace it with the day of the week, in this case "friday", the file name will include it.

Note: If you have a static name for a scheduled back up the file will be over written.

-{ Quote: "Also, how can I change the Label = command toward the bottom so the label will have the current date and time of the backup? " }-
Replace label = "no comment" with
label = "$(YEAR)_$(MONTH)$(DAY)"

You can re-arrange the variables "$(YEAR)" "$(MONTH)" "$(DAY)" syntax to suite your needs.

ByondF1
September 8th, 2009, 03:04 PM
I knew that part, what I wanted to know was how to use the STRINGDAYOFWEEK field to put the Friday or Monday or whatever in there so that I only had 5 daily backups and they weren't numbered. If you have any sample scripts that use iff statements and fields like the STRINGDAYOF... that would be great. Just point me to them.

Thanx

Paragon_Cisco
September 8th, 2009, 05:44 PM
Here is a link to the script manual: http://download.paragon-software.com/doc/script_man.pdf

I do not have an example script with "STRINGDAYOFWEEK" but If you browse to C:\Program Files\Paragon Software\Drive Backup 9 (edition)\scripts\ directory you will find the following scripts:

cyclbckp.psl
Iincremental.psl
Nincremental.psl

These will provide you with examples of similar scripting.