This function copies a source file to destination file to host
The name of the source fule
The name of the destination fule
The name of remote host (default localhost)
'%s' % (STAF_LOCAL_HOSTNAME)
'fs'
'COPY FILE %s TOFILE %s TOMACHINE %s' % (srcfile,destfile,remotehost)
{ 'returncode' : cmdRC ,
'result' : cmdResult }
cmdRC
Copies files by extension from a source to destination folder on host
The name of the source folder
The name of the destination fule
The name of host (default txt)
The name of remote host (default localhost)
'%s' % (STAF_LOCAL_HOSTNAME)
'fs'
'COPY DIRECTORY %s TODIRECTORY %s TOMACHINE %s EXT %s RECURSE' % (srcfolder,destfolder,hostname,extension)
{ 'returncode' : cmdRC ,
'result' : cmdResult }
cmdRC
This function zips a folder on remote machine
name of zip file
name of destination folder to place zip file contents
folder that the zip archive is relative to
'%s' % (STAF_LOCAL_HOSTNAME)
'zip'
'ADD ZIPFILE %s DIRECTORY %s RECURSE RELATIVETO %s' % (zipfilename,foldername,relativeto)
{ 'returncode' : cmdRC ,
'result' : cmdResult }
cmdRC
This function unzips a compressed zip archive on remote machine
name of source zip file
name of destination folder to place zip file contents
name of host on which to unzip (default localhost)
'%s' % (ziphost)
'zip'
'UNZIP ZIPFILE %s TODIRECTORY %s RESTOREPERMISSION REPLACE' % (zipfile,unzipdir)
{ 'returncode' : cmdRC ,
'result' : cmdResult }
cmdRC
This function recursively deletes a folder
name of file to be deleted
name of target host
'%s' % (hostname)
'fs'
'GET ENTRY %s TYPE' % (filename)
'Success: File does not exist, dont delete it.'
0
'Success: File does exists, will delete it'
'%s' % (hostname)
'fs'
'DELETE ENTRY %s CONFIRM' % (filename)
{ 'returncode' : cmdRC ,
'result' : cmdResult }
cmdRC
This function recursively deletes a folder
name of folder to be deleted
name of target host
'%s' % (hostname)
'fs'
'DELETE ENTRY %s RECURSE IGNOREERRORS CONFIRM' % (foldername)
{ 'returncode' : cmdRC ,
'result' : cmdResult }
cmdRC