Comments (5)
Now the backup seems to complete successfully.
This is because there is no dir check on an existing directory. Try to play around with edge cases, where the directory does not exist, or is a file or a symlink, etc.
Besides, a little bit later down the lines, there is also a test -L
check required for incremental backups. I guess this might also be an issue on your side.
The test
command currently works well and keeps the source simple. I honestly don't see a way of replacing them. Feel free though to make suggestions and always keep edge cases in mind.
On the other hand, why don't you just allow the test
command as well?
from linux-timemachine.
keeps the source simple
One of the great things about linux-timemachine :)
If I were to allow the test
command, users could probe for files outside their restricted directory. Besides, test
alongside rrsync
would require writing a wrapper script.
The test -L
check would be an issue if my destination is accessed via SSH. But I'm only using my SSH server as source (made it read-only with rrsync
). So that's not a problem in this case.
I was thinking maybe instead of test something like this:
if [[ $(rsync "${directory}" . --dry-run 2>/dev/null) == "skipping directory"* ]];then echo "It is a directory"; fi
Tested with a file, directory, symlink and nonexistent file.
I know it's ugly, but does not require another command besides rsync
and works with rrsync
xD
from linux-timemachine.
If I were to allow the
test
command, users could probe for files outside their restricted directory.
Isn't that something you could do with a shell anyways?
if [ -f ./some_file ]; then echo "some_file exists"; fi
from linux-timemachine.
You can also use the Nvm, sed
command (also used in the script) to probe for files:sed
is only run locally
> sed -i'' 's///' file
sed: -e expression #1, char 0: no previous regular expression
> sed -i'' 's///' fileno
sed: can't read fileno: No such file or directory
from linux-timemachine.
Isn't that something you could do with a shell anyways?
Yes, but my plan was to block shell access and only allow rrsync
over SSH. So users won't be able to run the commands you suggested (which is good) and can't probe or access files outside of their restricted directory.
However then they also won't be able to run the test
command and linux-timemachine
won't work.
So that's why I suggested to not rely on test
, or find a way to replace test
with an rsync
command (which rrsync
would allow).
For the time being I'm chrooting SSH users to their home directory, so they can't use rsync
at all...
from linux-timemachine.
Related Issues (20)
- Is there a reason for not allowing a remote source? HOT 3
- exclude file/dir options? HOT 3
- suggestion to add --without-overlaps option HOT 1
- Suggestion | Allow remote source HOT 2
- Suggestion: multiple SOURCEs HOT 2
- suggestion: my excludes, necessary / useful HOT 1
- Feature: a form of progress indication HOT 1
- Problem with some paths/volume names HOT 8
- File permission issues cause backups to stop being created HOT 8
- How to use --files-from from rsync? HOT 1
- How to skip broken soft links? HOT 2
- Missing destination folder is resulting in script fail HOT 2
- Missing variable when local directory is missing HOT 6
- Problem with moving .inprogress dir HOT 2
- include file options
- Backup fails because of a file that is not even into the source directory to be backed up `sync warning: some files vanished before they could be transferred (code 24)` HOT 1
- Errors from path arguments with spaces
- Allow rsync options to be passed without requiring double quoting (--filter="'dir-merge /.rsync-filter'")
- Suggestion: improved doc for running tests / testing on MacOS 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linux-timemachine.