dzu
v0.3.4
Published
Dan's Zip Util - A rudimentary CLI-based backup tool.
Downloads
15
Readme
Dan's Zip Util
A rudimentary CLI-based backup tool.
Tell it:
- Which folders you want backed-up
- Where to save backups
And it will:
- Zip the folders up
- Name them according to today's date
- Copy them to each location you've requested
Installation
DZU is available from NPM, just run:
npm i -g dzuBasic Usage
When you first setup DZU, you'll need to tell it which folders to backup and save backups to.
dzu init
dzu protect /path/to/precious-photos
dzu protect /path/to/precious-documents
dzu use /path/to/backups-folderBut once that's done, whenever it comes time to run a backup, all you need to do is:
dzu runFor more information about the available commands, run dzu help.
Developing DZU
First, if you have
dzuinstalled, temporarily uninstall it withnpm uninstall -g dzu.Next, clone the repo, install dependencies, and setup the needed symlinks with:
git clone https://github.com/dan-schel/dzu.git cd dzu npm i npm link npm link dzuThis creates two symlinks at the location where NodeJS is installed, e.g.
/home/dan/.nvm/versions/node/v22.16.0. The first is in[NODEJS]/bin/dzu, which symlinks to[NODEJS]/lib/node_modules/dzu, which itself is a symlink to the cloned repository.Rename both symlinks to
dzu-devor something. (Be sure to update the symlink at[NODEJS]/bin/dzuto point to the renamed[NODEJS]/lib/node_modules/dzu-dev.)In a new terminal, run
npm run devand leave it running in the background.Now that both symlinks are renamed
dzu-dev, you should be able to safely re-install the productiondzufrom NPM if you wish.Now so long as
npm run devremains running, thedzu-devcommand should react to source code changes inside this folder. The regulardzucommand will still run the production version, completely unaffected by anything we touch here.You can test it by modifying the
versionfield inpackage.json. Runningdzu-dev -vshould cause the updated value to print, howeverdzu -vshould still match whichever version you've installed from NPM.(This separation extends to the configuration. The development version will store configuration in a separate
~/.dzu-devfile to avoid impacting~/.dzu.)
