Using sudo
in all of your examples is a red flag that might deter people.
I took sudo out of the examples and disabled it by default within the script. I still have a personal use for it.
I keep a local backup on each device then transfer that backup to my desktop. Rsync requires root access to transfer files or directories with certain attributes over ssh. Otherwise the backup copy to my desktop is incomplete.
Fortunately I already coded in a toggle for requesting root since Termux on Android has no root by default. I just won't note that in the readme file. That can be left for anyone who cares to read the code itself.
Why are superuser privileges necessary? That's highly suspect.
I use a lot of commands that either use the --delete option or require remote root access in order to preserve hard links and other attributes.
I didn't know that was an issue. I was going from my own limited experience with linux.
I already set an option to disable the root requirement at the beginning of the script. Simply changing the value to 0 will disable it and will let rsync display it's own errors.
What exactly makes it suspect so I know what I'm doing?
Shell Scripting
From Ash, Bash and Csh to Xonsh, Ysh and Zsh; all shell languages are welcome here!
Rules:
- Follow Lemmy rules!
- Posts must relate to shell scripting. (See bottom of sidebar for more information.)
- Only make helpful replies to questions. This is not the place for low effort joke answers.
- No discussion about piracy or hacking.
- If you find a solution to your problem by other means, please take your time to write down the steps you used to solve your problem in the original post. You can potentially help others having the same problem!
- These rules will change as the community grows.
Keep posts about shell scripting! Here are some guidelines to help:
- Allowed: Release Announcement of a command-line program designed for scripted use (e.g. bash, bats, awk, jq, coreutils/moreutils)
- Allowed: Tutorials on using shell languages or supplementary tools designed for scripted use
- Allowed: Code review/help requests for shell languages or supplementary tools designed for scripted use
- NOT Allowed: Announcement of a CLI or TUI program that is not designed for scripted use (Yes, your fancy Zsh plugin which pretty-prints the date and time using only builtins is very cool, but unless you actually want to discuss the code itself, please check out !commandline instead!)
- NOT Allowed: Domain-specific tutorials that do not involve shell scripting as a core component (e.g. docker-compose, ansible, nix). If you really love one of these, I'm sure there's a community out there ready to talk about them!
- NOT Allowed: Code review requests for non-shell programming languages and configuration languages (e.g. Python, Yaml)
In general, if your submission text is primarily shell code, then it is welcome here!