File BaRJ (File Backup and Restore Java) is a multi-platform backup utility for files. It is intended to be a highly configurable tool that can create secure backups of preconfigured files and folders and can be easily scheduled.
This module provides a CLI entry point for defining and executing File BaRJ backup tasks using the high level API provided by the File BaRJ Core package.
Warning
File BaRJ is a free tool that is provided "as is", without warranty of any kind. It might be the perfect tool you need, or leave you with gigabytes of encrypted hot mess instead of your precious data. By using it, you accept the risk of data loss (among others).
Execute the following command (assuming that your executable is named accordingly).
java -jar build/libs/file-barj-job.jar \
--gen-keys \
--key-store keys.p12 \
--key-alias alias
Follow the I/O prompts on the console to provide the necessary passwords. Save the printed public key as you will need it later when configuring your backup job.
Configure your backup job using the Backup job configuration tips page.
Execute the following command (assuming that your executable is named accordingly).
java -jar build/libs/file-barj-job.jar \
--backup \
--config config.json \
--force-full-backup false \
--threads 2
Execute the following command (assuming that your executable is named accordingly).
java -jar build/libs/file-barj-job.jar \
--merge \
--backup-source /backup/directory/path \
--prefix backup-job-file-prefix \
--delete-obsolete false \
--key-store keys.p12 \
--key-alias alias \
--from-epoch-seconds 123456 \
--to-epoch-seconds 234567
The above command will merge all backup files starting with the one created at 123456 (epoch seconds), including the last file created at 234567 (epoch seconds) and also including every other increment between them.
Warning
If there is a full backup between the two, every incremental backup in the range which was created before the last full backup of the range will be ignored during the merge and deleted if the configuration allows deletion of obsolete files.
Execute the following command (assuming that your executable is named accordingly).
java -jar build/libs/file-barj-job.jar \
--restore \
--backup-source /backup/directory/path \
--prefix backup-job-file-prefix \
--target-mapping /original/path=/restore/path \
--dry-run true \
--delete-missing true \
--key-store keys.p12 \
--key-alias alias \
--at-epoch-seconds 123456 \
--include-path /original/path/filter \
--permission-comparison STRICT \
--threads 2
Execute the following command (assuming that your executable is named accordingly).
java -jar build/libs/file-barj-job.jar \
--inspect-increments \
--backup-source /backup/directory/path \
--prefix backup-job-file-prefix \
--key-store keys.p12 \
--key-alias alias
Execute the following command (assuming that your executable is named accordingly).
java -jar build/libs/file-barj-job.jar \
--inspect-content \
--backup-source /backup/directory/path \
--prefix backup-job-file-prefix \
--key-store keys.p12 \
--key-alias alias \
--output-file /path/to/output.tsv \
--at-epoch-seconds 123456
This task allows the deletion of those backup increments which became obsolete. In order to keep only working backups, this will remove all increments starting with the one created at the selected epoch seconds time and ending before the next full backup (or deleting all if no full backup found). In the example below, we want to delete the increment started at 123456 (epoch seconds) amd every subsequent incremental backup until the next full backup.
Execute the following command (assuming that your executable is named accordingly).
java -jar build/libs/file-barj-job.jar \
--delete \
--backup-source /backup/directory/path \
--prefix backup-job-file-prefix \
--key-store keys.p12 \
--key-alias alias \
--from-epoch-seconds 123456
Please read more about configuring the BaRJ backup jobs here.