Run FTP commands from the calling machine.
Lists the contents of the directory at the given path on a remote FTP server.
the location or server to list from
the path of the directory to list
FTP options object
The directory listing - Directory Listing object
// retrieves the contents of `/mnt/centralstore` as DirectoryListing
const storeDirectoryListing = busby.ftp.listDirectory("192.168.20.4:21", "/mnt/centralstore", {username:"test", password:"test1", timeout:10})
Checks whether a file exists or not on a remote FTP server.
The remote ftp server address - ip address or hostname and optionally port if not the default port 21 ie192.168.20.2:22
The file path to store the file on the FTP serverwith a leading/
ie/storageFolder/fileToGet.mxf
FTP options onject
{boolean} Returns true if exists, false if it does not exist, or if the connection times out
// checks if `transcodeLogFile.log` exists
const logFileExists = busby.ftp.checkFileExists("192.168.20.4:21", "/incoming-log-files/transcodeLogFile.log", {username:"test", password:"test1", timeout:10})
Retrieve a file from a remote FTP server and download to a local file path.
The remote ftp server address - ip address or hostname and optionally port if not the default port 21 ie192.168.20.2:22
The file path of the file to retrieve on the FTP serverwith a leading/
ie/storageFolder/fileToGet.mxf
The local file path where the file is to be downloaded to
FTP options object
{boolean} Returns true if successful, false otherwise
// gets `bigBuckBunny.mxf` from an ftp server using the username `secureUser` and password `securePassword` with a timeout of 10 seconds
const success = busby.ftp.getFile("192.168.20.4:21", "/hd-content/bigBuckBunny.mxf", "/home/squared/bigBuckBunny.mxf", {username:"test", password:"test1", timeout:10})
Uploads a file to a remote FTP server from a local file path.
The local file path where the file to be uploaded resides
The remote ftp server address - ip address or hostname and optionally port if not the default port 21 ie192.168.20.2:22
The file path to store the file on the FTP serverwith a leading/
ie/storageFolder/fileToGet.mxf
FTP options object
{boolean} Returns true if successful, false otherwise
// puts `transcodeLogFile.log` onto an ftp server using the username `secureUser` and password `securePassword` with a timeout of 10 seconds
const success = busby.ftp.putFile("/var/log/transcodeLogFile.log", "192.168.20.4:21", "/incoming-log-files/transcodeLogFile.log", {username: "test", password:"test1", "timeout":10})