[DEFNAME BACKUPDEF]
SERVUID 0166e5 //UID used to perform certain server funtions (use a plevel 7 account's char uid)
WINRAR c:\progra~1\winrar\winrar.exe //Full path to the winrar program (must be DOS format... no space)
WINPASS password //password to encrypt the ziped file (remove the -hp switch to disable password encryption)
WINNAME c:\sphere\Backup\name //Full path and name of the wanted ziped file (name will take "name-date" format)
WINLIST c:\sphere\backup.lst //Full path to the file containing the list of files to zip)
[FUNCTION rtime.day]
return <strsub 8 2 <serv.rtime>>
[FUNCTION f_onserver_save_ok]
LCOAL.OLDOBJ <OBJ.UID>
OBJ <DEF0.SERVUID>
OBJ.MAKEBACKUP
OBJ <LCOAL.OLDOBJ>
[FUNCTION MAKEBACKUP]
//ARGN = force backup
IF !(<rtime.day> == <VAR0.lastbackup>) || (<ARGN>)
LOCAL.BACKUP <sysspawn <DEF0.WINRAR> a -r -s -m5 -k -hp<DEF0.WINPASS> -ibck -ag-YY-MM-DD <DEF0.WINNAME> @<DEF0.WINLIST>>
VAR.lastbackup = <rtime.day>
SERV.LOG Backup complete
ENDIF