@tdxvolt/folder-sync v0.1.14
@tdxvolt/folder-sync
Bi-directional synchronisation of folders between two or more locations.
Usage
The application is parameterised using 3 arguments:
npx @tdxvolt/folder-sync [folder-path] [sync-database] [volt-config-path]
folder-path
- The path to the folder to be synchronised. This can be a relative or absolute path.sync-database
- The id or alias of the Volt resource to use as the sync database.volt-config-path
- The path to the configuration file containing credentials for accessing the Volt that is hosting the sync database.
Example
To synchronise a folder called project-acme
in the home directory with a Volt resource called @acme-db
using the configuration file volt.config.json
located in the home directory:
npx @tdxvolt/folder-sync /home/user/project-acme @acme-db /home/user/volt.config.json
Demo
Running the application with no arguments will synchronise with a demonstration database hosted on a Volt running in the cloud to a local folder called demo
in the current working directory.
npx @tdxvolt/folder-sync
Setup
As outlined above, folder-sync
requires details of a sync database Volt resource to synchronise with. The identifier or alias of the resource is given as the second argument to the application, and the credentials for connection to the Volt are given as the third argument.
You can run folder-sync
using details that have been shared with you, or you can create your own sync database resource and configure the application to use it.
The Volt management console fusebox
is the easiest way to create and manage Volt resources. Use the new
menu in the toolbar and select the sync database
option from the menu.
The Volt credentials are stored in a JSON file, and the path to the file is given as the third argument to the application.
You can create an account via the fusebox
by navigating to the account
folder and selecting the new
button from the toolbar.
Make sure to share the sync database created above with the new account. You should give it database-read
permission to allow it to receive synchronisation updates, and database-write
permission if you want to permit the application to create synchronisation updates.
Once the account has been created, you can copy the credentials from the fusebox
and paste them into the volt.config.json
file.
Daemonise
The application can be daemonised using PM2.
pm2 start npx @tdxvolt/folder-sync -- /path/to/folder sync-db-id /path/to/volt.config.json