getFile()
Upload the file at the specified path from the managed machine. Be sure to enter a full path filename that you want to upload. Example: news\info.txt
. Folders are created when the getFile() command is run, if they don't already exist. The file is stored on the Kaseya Server in a private directory for each managed machine. View or run the uploaded file using Agent Procedures > Get File.
- If file already exists on the server, it will only be uploaded again if it has changed.
- Optionally, existing copies of uploaded files are renamed with a
.bak
extension prior to the next upload of the file. This allows you to examine both the latest version of the file and the previous version. - Optionally create a Get File alert if the uploaded file differs or is the same from the file that was uploaded previously. You must create a Get File alert for a machine ID using the Monitor > Alerts - Get File page to enable the sending of an alert using the getFile() command. Once defined for a machine ID, the same Get File alert is active for any agent procedure that uses a getFile() command and is run on that machine ID. Turn off alerts for specific files in the agent procedure editor by selecting one of the without alerts options.
- Do not enclose the file path in quotes, even if it contains spaces. They will be added automatically by the procedure editor.
- See getFileInDirectoryPath().
Example
getFile("c:\temp\NetStopInfoStore.txt", "backuplogs\NetStopInfoStore.txt", "Overwrite existing file and sent alert if file changed", "All Operating Systems", "Halt on Fail")