Skip to main content
Deno 2 is finally here 🎉️
Learn more

Read before using

Dependencies

  1. deno. See installation guide

To add deno to the path, after installing it.

  1. nano ~/.bashrc.
  2. Add the following two lines at the end or edit PATH accordingly if it already exists: export DENO_INSTALL="/root/.deno" export PATH="$DENO_INSTALL/bin:$PATH", but substitute /root with the directory in which deno is installed.
  3. Save and close.
  4. cd.
  5. . .bashrc.

How to use

  1. Clone the repository in your server and change directory to it.
  2. Change to this branch with git checkout deno.
  3. Copy constants.example1.ts to constants.ts: cp constants.example1.ts constants.ts.
  4. Modify constants.ts to suit your needs.
  5. Run deno task run --help to see the possible commands.

If you want to update the code, run git pull.

Using the script

To run the script

deno task run

To run the script in a specific directory

deno task run --cwd /path/to/directory

To copy some shard’s files from a node to another

deno task run copy [fromNodeIndex] [toNodeIndex] [...shards=[beacon]]
Examples
  • Copy the beacon shard from node 0 to node 1
deno task run copy 0 1
  • Copy the beacon and shard2 from node 0 to node 1
deno task run copy 0 1 beacon shard2
  • You could also just use the shard index
deno task run copy 0 1 beacon 2

To move some shard’s files from a node to another

It uses the same syntax as copy.

deno task run move [fromNodeIndex] [toNodeIndex] [...shards=[beacon]]

To get the status and total files of each node’s shards

deno task run info [...nodeIndexes=all]
Examples
  • Get the status of all nodes
deno task run info
  • Get the status of node 0 and 1
deno task run info 0 1

Using crontab

With crontab you can configure the script to run every day.

  1. Run crontab -e
  2. Write 0 0 * * * deno task --cwd /root/Duplicated-files-cleaner-Incognito run at the end of the file, modifying the path if yours is different. I recommend runnig the command before to see if it works.

Troubleshooting

If you run into problems, you can safely delete the file located at db/database.db and try again. If that doesn’t solve the problem, open an issue.