sync-dir-ftp
v1.0.2
Published
Sync a directory by ftp
Readme
Sync Dir by FTP
Easily synchronize local directories with an FTP server.
Features
- Sync files and folders between a local directory and an FTP server.
- Ignore files and folders specified in the .gitignore file.
- Detect changes in the local directory and synchronize them with the FTP server.
Installation
npm i sync-dir-ftpor
npm i -g sync-dir-ftpHow to use
In the directory where you want to synchronize via FTP, create a .env file with the following content:
FTP_HOST=myftpserver.com
FTP_USER=user
FTP_PASSWORD=password
FTP_SECURE=trueWhere:
FTP_HOST: (string) FTP server host.FTP_USER: (string) FTP server username.FTP_PASSWORD: (string) FTP server password.FTP_SECURE: (boolean | "implicit") Explicit FTPS over TLS, default: false. Use "implicit" if you need support for legacy implicit FTPS.
Then, in local installation, run:
npx sync-dir-ftpIn global installation, run:
sync-dir-ftpℹ️ Note: By default, all content in the directory where the command is executed is synchronized.
If you want to synchronize a specific subdirectory within the directory where the command is being executed, you must add the following parameter to the .env file:
PATH_TO_SYNC=path/to/syncTo ignore files and directories, they must be specified in a .gitignore file within the directory where the command is being executed.
Currently, the command partially supports the following wildcards in the .gitignore file:
*: Will ignore all files and directories that end with the specified character or characters.#: Lines starting with#will be ignored.
⚠️ Warning: For security reasons, it is recommended to ignore the .env file since the command could upload the .env file, leaving access credentials exposed."
