This function copies a source file to destination file to host Location of target host The name of remote host (default localhost) The name of the source fule The name of the destination fule '%s' % location 'fs' 'COPY FILE %s TOFILE %s TOMACHINE %s' % (srcfile,destfile,remotehost) { 'returncode' : cmdRC , 'result' : cmdResult } [cmdRC,cmdResult] Copies files by extension from a source to destination folder on host Location of target host The name of remote host (default same as location) The name of the source folder The name of the destination file The name of the file extension (default txt) '%s' % location 'fs' 'COPY DIRECTORY %s TODIRECTORY %s TOMACHINE %s EXT %s RECURSE' % (srcfolder,destfolder,remotehost,extension) { 'returncode' : cmdRC , 'result' : cmdResult } cmdRC This function zips up a folder Location of target host Name of the file to place zip file contents Name of destination folder to place zip file contents Folder that the zip archive is relative to '%s' % location 'zip' 'ADD ZIPFILE %s DIRECTORY %s RECURSE RELATIVETO %s' % (zipfile,folder,relativeto) { 'returncode' : cmdRC , 'result' : cmdResult } cmdRC This function unzips a compressed zip archive Location of target host Name of the file to place zip file contents Name of destination folder to place zip file contents '%s' % location 'zip' 'UNZIP ZIPFILE %s TODIRECTORY %s RESTOREPERMISSION REPLACE' % (zipfile,unzipdir) { 'returncode' : cmdRC , 'result' : cmdResult } cmdRC This function deletes a file Location of target host Name of file to be deleted '%s' % location 'fs' 'GET ENTRY %s TYPE' % (filename) 'Success: File does not exist, dont delete it.' 0 'Success: File does exists, will delete it' '%s' % location 'fs' 'DELETE ENTRY %s CONFIRM' % filename { 'returncode' : cmdRC , 'result' : cmdResult } cmdRC This function recursively deletes a folder Location of target host Name of folder to be deleted '%s' % location 'fs' 'GET ENTRY %s TYPE' % foldername 'Folder does not exist, do not delete it.' 0 'Folder exists, will delete it' '%s' % location 'fs' 'DELETE ENTRY %s RECURSE IGNOREERRORS CONFIRM' % (foldername) { 'returncode' : cmdRC , 'result' : cmdResult } cmdRC This function creates a folder Location of target host Name of file to be deleted '%s' % location 'fs' 'CREATE DIRECTORY %s FULLPATH' % foldername { 'returncode' : cmdRC , 'result' : cmdResult } cmdRC Queries the staf logs from startfrom point Location of target host Name of file to be deleted Name of file to be deleted Name of file to be deleted '%s' % location 'log' 'QUERY ALL MACHINE %s LOGNAME %s FROM %s TO %s' % (location,logname,startfrom,endat) Sets a variable in the staf var service Location of target host Name of file to be deleted Name of file to be deleted 'Set %s Variable %s' % (type,variable) '%s' % location 'var' 'SET %s VAR %s' % (type,variable) Gets a variable in the staf var service Location of target host Name of file to be deleted Name of file to be deleted 'Get %s Variable %s' % (type,variable) '%s' % location 'var' 'GET %s VAR %s' % (type,variable) Resolve a variable in the staf var service Location of target host Type of string to be resolved Name of string to be resolved 'Resolve %s Variable %s' % (type,string) '%s' % location 'var' 'RESOLVE %s STRING {%s}' % (type,string) Retrieves an attribute of a file system entry Location of target host Name of entry to retrieve attributes Type of attributes to be retrieved 'Retrieve attribute %s for %s.' % (attribute,entry) '%s' % location 'fs' 'GET ENTRY %s %s' % (entry,attribute)