From 5358267771fc7eca23c28e890141666ad23512ed Mon Sep 17 00:00:00 2001 From: Mroik Date: Tue, 24 Jun 2025 18:35:47 +0200 Subject: Include empty directories --- README.md | 10 +++++----- src/main.rs | 5 ++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9af63c9..7ba9c88 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # Orange Whale -Orange whale is a backup software that usage telegram as free storge. A docker image is available, just mount +Orange whale is a backup software that uses telegram as free storge. A docker image is available, just mount the folders you want to backup and pass the folder names to `LOCATIONS` to tell Orange Whale what to upload. It requires you to also mount `/app/pub.txt`, a file containing your public PGP key. Yes it is required, and yes -it is useful, don't upload your personal data on external services without encrypting them. +it is useful. DO NOT upload your personal data on external services without encrypting them. Now the following envvar: -- `TELOXIDE_TOKEN`: is the telegram bot token you'll be using +- `TELOXIDE_TOKEN`: is the token of the telegram bot you'll be using - `CHAT_ID`: the group/channel your bot will upload to - `LOCATIONS`: the folders to upload -- `INTERVAL`: how often to upload in hours. It takes an integer -- `RUST_LOG`: for logging stuff. If you're using it with docker I advise you to set it to `info` +- `INTERVAL`: an integer indicating how often to backup specified in hours +- `RUST_LOG`: logging verbosity. If you're using docker I advise you to set it to `info` ## Backups Once the bot starts uploading you'll realize that the data is split in multiple parts. That's because bots on diff --git a/src/main.rs b/src/main.rs index 86c8a23..3be794a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -118,9 +118,8 @@ fn list_leafs(acc: &mut Vec, path: &str) -> Result<()> { for entry in std::fs::read_dir(path)? { match entry { Ok(e) => { - if !e.file_type().unwrap().is_dir() { - acc.push(format!("{}/{}", path, e.file_name().to_str().unwrap())); - } else { + acc.push(format!("{}/{}", path, e.file_name().to_str().unwrap())); + if e.file_type().unwrap().is_dir() { list_leafs( acc, &format!("{}/{}", path, e.file_name().to_str().unwrap()), -- cgit v1.2.3