HomeProductsSysax Multi ServerHelp Manuals › Serverscript

Sample Script to respond to Server Event Triggers

This default script is auto generated by the Sysax Multi Server software on installation and can be customized as needed.


    #
    # Name: serverscript.fscr 
    # Desc: This script will be executed if server scripting is enabled and one of the trigger 
    #       conditions is satisfied. The following variables are preloaded before the script 
    #       starts executing. These variables provide information about the type of trigger 
    #       that caused the script to execute and some information about the triggered event: 
    #
    #       ~SERVER_TRIGGER        - This variable provides information on the type of trigger that 
    #                                caused the script to execute. Possible values are: 
    #                                "loginok"    - A user successfully logged into an account 
    #                                "loginerror" - A user tried to login but was rejected 
    #                                "download"   - A user successfully downloaded a file 
    #                                "upload"     - A user successfully uploaded a file 
    #                                "rename"     - A user successfully renamed a file 
    #                                "delete"     - A user successfully deleted a file 
    #
    #       ~SERVER_ACCOUNT        - This variable contains the user account name that generated the 
    #                                event 
    #
    #       ~SERVER_IPADDRESS      - This variable contains the IP address name of the connection that 
    #                                generated the event 
    #
    #       ~SERVER_FILENAME       - This variable contains the filename if this is a download, upload, 
    #                                rename, or delete event. For a delete event, this variable contains 
    #                                the former name of the file that was deleted. For a rename event, 
    #                                this variable contains the new name 
    #
    #       ~SERVER_ABSFILENAME    - This variable contains the absolute filename if this is a download, 
    #                                upload, rename, or delete event. For a delete event, this variable 
    #                                contains the former absolute name of the file that was deleted. For 
    #                                a rename event, this variable contains the new absolute name 
    #
    #       ~SERVER_OLDFILENAME    - This variable contains the old filename for a rename event 
    #
    #       ~SERVER_OLDABSFILENAME - This variable contains the old absolute filename for a rename event 
    #
    #       This script can be used to perform file transfers, local file processing, send email, or 
    #       even run other programs. Please refer to the scripting manual for a complete list of script 
    #       commands. 
    #
    
    print "Starting to execute server script ..."; 
    
    
    # Simply print out the values of the preloaded variables 
    #
    print "The server trigger type is ", ~SERVER_TRIGGER; 
    print "The user account name is ", ~SERVER_ACCOUNT; 
    print "The connection IP address is ", ~SERVER_IPADDRESS; 
    print "The filename that was processed is ", ~SERVER_FILENAME; 
    print "The absolute path to the filename that was processed is ", ~SERVER_ABSFILENAME; 
    
    
    # detect if a specific user has logged in 
    if ~SERVER_TRIGGER eq "loginok" begin 
      if ~SERVER_ACCOUNT eq "myaccount" begin 
        if ~SERVER_IPADDRESS eq "192.168.1.1" begin 
          print "A known user has logged into myaccount"; 
        end 
      end 
    end