Command Line FTP


This article provides instructions for configuring the Command Line FTP client to work with Egnyte. For background information about uploading files using FTP, and access to other FTP configuration guides, please read this article.

Exclusions: Please refer to this article for unsupported characters and excluded file types that will not be synced. 

FTP / FTPES

SFTP

FTP / FTPES

LINUX / POSIX

cURL can be easily used to transfer files using FTP protocol and with SSL.

A prototype:

curl -k -T <file> --ftp-ssl --ftp-pasv -u "<egnyte-user>\mce_markerlt;egnyte-domain>:<egnyte-password>" ftp://ftp-<egnyte-domain>.egnyte.com/

For example if you have to transfer a local file called testfile.txt and you want to upload to the root of your FTP directory:

curl -k -T testfile.txt --ftp-ssl --ftp-pasv -u "username\$domain:password" ftp://ftp-domain.egnyte.com/

Creating a directory:

curl -k -Q "MKD /Shared/testdirectory" --ftp-ssl --ftp-pasv -u "username\$domain:password" ftp://ftp-domain.egnyte.com/

Uploading file to the created directory:

curl -k -T testfile.txt --ftp-ssl --ftp-pasv -u "username\$domain:password" ftp://ftp-domain.egnyte.com/Shared/testdirectory/

You can FTP files into a folder under Shared using a script:

Here is a simple curl :

curl --user <username>@<domain_name>:<password> -T <File Path> ftp://ftp-<domain_name>.egnyte.com/Shared/mybackup/somefile.txt 

  • /Shared/mybackup should be valid directory that already exists.

To Download

curl -k --ftp-ssl --ftp-pasv -u "<username>\$<domainName without egnyte.com>:<password>" ftp://<ftp url>/Shared/Documents/<filename>

  • Replace <username> with the actual Egnyte username.
  • Replace <domain> with the actual Egnyte domain.
  • Replace <password> with the actual Egnyte password.

You can carefully script each basic operation needed. For a simple operation of backing up log files, you can run a script once each day that creates a directory representing that day (date-time) and upload log files to that directory on FTP and over SSL.

You can avoid including the plain text password in the curl command, for example:

curl -k -T testfile.txt --ftp-ssl --ftp-pasv -u "username\$domain" ftp://ftp-domain.egnyte.com/Shared/testdirectory/

Will then prompt you for a password before starting transfer. 

SFTP

We recommend using the standard Linux sshpass command line utility for scripting. It is necessary to ensure proper access to the local file containing the authentication information (password). After that, if, for instance, your SSH password is stored within a file ~/.ssh/secret, you can use the following command line to connect to Egnyte SFTP:

$ sshpass -f ~/.ssh/secret sftp 'username$domain'@ftp-domain.egnyte.com
Connected to ftp-domain.egnyte.com.
sftp> 

Here, domain should be replaced with your real domain and username replaced with your real Egnyte username. 

Egnyte Community

Egnyte Community

Want to connect with other Egnyte users and our Egnyte team? Share ideas and ask questions in our Community .