SphereCommunity
Syscmd sysspawn - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Syscmd sysspawn (/Thread-Syscmd-sysspawn)



Syscmd sysspawn - xotapt - 03-20-2013 07:29 AM

Hi all,

going on trought the changelog/revisions, i ended up with exactly what i needed

the commands Syscmd and Sysspawn, however there seems to be no information/example of them actualy working, i have tried several ways to make them execute an external app, but no luck so far.

Can someone post an example or some info on how to achieve that?

th


RE: Syscmd sysspawn - Ben - 03-20-2013 07:53 AM

This is an old script I had made to create a backup of the server.

PHP Code:
[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---m5 --hp<DEF0.WINPASS> -ibck -ag-YY-MM-DD <DEF0.WINNAME> @<DEF0.WINLIST>>
VAR.
lastbackup = <rtime.day>
SERV.LOG Backup complete
ENDIF