A OCaml-based dropbox command line clone. It supports incremental backup, history files retrival, and other basic functions.
Download the repository.
make dependencies # to install opium, cohttp dependencies
make
make install # or 'sudo make install' to install caml_sync to your terminal
Using ifconfig
to check your public ip address or using 127.0.0.1
if you only want to run locally. server
, client1
and client2
are three computers or three terminal windows if you want to run locally.
# server
mkdir server
cd server
camlsyncserver init password
camlsyncserver
# client1
mkdir client1
cd client1
camlsync init 127.0.0.1:8080 password
# client2
mkdir client2
cd client2
camlsync init 127.0.0.1:8080 password
# client1
echo hello3110 > 3110.txt
camlsync
# client2
camlsync
cat 3110.txt # print "hello3110"
caml_sync has a server and a client. After make install
, camlsync
and camlsyncserver
will be installed to your terminal.
camlsyncserver [<init token> | <clean>]
camlsyncserver init
camlsyncserver init <token>
It initializes a server environment with a token in the current folder. If token is omitted, the token will be set to default
as default.
camlsyncserver
After initialization, this command can launch the server.
ocamlsyncserver clean
It cleans up all files generated by cam_sync server.
camlsync [<init [url token]> | <clean> | <checkout> | <status> | <history num | list | clean> | <conflict [clean]>]
camlsync init
camlsync init url token
It initializes a client environment with a server location and a token in the current folder. After initialization, it will automatically perform its first sync. If both of them are omitted, the url will be initialized to 127.0.0.1:8080
and the token will be initialized to default
. Note that if the server is also opened at the local computer, you cannot use locahost:8080
. You may use 127.0.0.1:8080
instead.
camlsync
It syncs with the server. It will first fetch any new changes made by the server and then push any local changes made locally. If there is a confict, the local version file will be renamed to filename_local
. You must solve these conflict files (remove filename_local
and make changes in filename
if you want) before you sync again. It only supports files with extensions .ml, .mli, .txt, .sh, .java, .c, .h, .md, .cpp, .py, .jl, .m, .csv, .json
camlsync checkout
It checks out any changes made locally since the last sync. It is similar to git checkout .
.
camlsync status
It displays current files status. It is similar to git status
.
camlsync history list
It displays all versions and their corresponding times.
camlsync history <num>
It will download all files at version num
to ./camlsync_history_version_<num>/
. Note that num
must be larger than or equal to 1 and less than or equal to the current version number.
camlsync history clean
It deletes all files and folders generated by camlsync history retrivel. In other words, it removes all folders named camlsync_history_version_<num>
in the current directory.
camlsync conflict
It displays all conflict files in the current working folder.
camlsync conflict clean
It removes all local version conflict files in the current folder. In other words, it removes all files ending with _local
.
camlsync clean
It removes all files generated by caml_sync client, including history folders and local version conflict files. Note that it will not remove files that are synced from the server.
make uninstall
This command will uninstall camlsync
and camlsyncserver