Comments (20)
Have you tried putting a back slash?
/home/dsanroma/directory\ with\ spaces/
from cya.
Yes I did... no dice... ;(
from cya.
Okay. Well that needs to be patched and honestly has the highest priority out of all these issues.
from cya.
Makes sense, of course... Bugs first, features later... ;)
I will keep on testing different things and scenarios...
from cya.
All you need to do is try \\
/home/dsanroma/directory\\ with\\ spaces/
from cya.
The double slashes got edited by github (makes sense) so in case you only check email first and not my revised post it is backslash backslash together or double backslashes. That will allow a slash to occur and spaces to work.
So /directory(backslashbackslashspace)with(backslashbackslashspace)spaces/
from cya.
Tested and it works!!!!
the /home/dsanroma/directory\\ with\\ spaces/
syntax works great!!!
Since it is not all that intuitive to have to "escape twice", maybe the syntax could be explained / specified in the cya configfile
command.
What do you think ?
from cya.
Yeah I already added it to the configfile information in 2.3.1+ dev/2.4
from cya.
I added the question label since there is nothing to change code wise. Also using labels to keep track of what has been done. You have been emailed a dev copy 2.3.1 for the three enhancements.
from cya.
Checks that "double-back-slash explanation" is present in:
BACKUP_DIRECTORIES
Explanation and Examples, both documented
EXCLUDE_/xxxx/
Explanation and Examples, both documented
BACKUP_FILES
Explanation and Examples, both documented
MYDATA_xxxx
Explanation and Examples, both documented
However, there is an error in this example provided in the configfile
command. According to the documentation, it should not include the leading forward slash.
EXCLUDE_/var/="/my\\ directory\\ with\\ spaces/"
should be
EXCLUDE_/var/="my\\ directory\\ with\\ spaces/"
from cya.
Good catch and a typo. Fixed in 2.3.2.
from cya.
The initial tests showed that the command cya directories
does handle the names with spaces correctly if \\
are provided before the spaces. So far, so good.
However, when I tried to run the backup with a cya save
command, I got the following errors on directories with spaces. Of course the \\
are there, otherwise cya directories
would not work either.
Backing up /home/dsanroma/directory with spaces/ ... rsync: link_stat "/home/dsanroma/directory" failed: No such file or directory (2)
rsync: link_stat "/home/dsanroma/with" failed: No such file or directory (2)
rsync: change_dir "/home/cya/points/2/home/dsanroma" failed: No such file or directory (2)
rsync: link_stat "/home/dsanroma/with" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1]
complete
Backing up /initrd.img ... complete
Backing up /initrd.img.old ... complete
Backing up /vmlinuz ... complete
Backing up /vmlinuz.old ... complete
Backing up /etc/hosts ... complete
Backing up /etc/bash_completion.d/git-prompt ... complete
Backing up /home/dsanroma/file with spaces ... rsync: link_stat "/home/dsanroma/file" failed: No such file or directory (2)
rsync: link_stat "/home/dsanroma/with" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1]
complete
from cya.
Confirmed. This will take time to address as spaces fixed in one area error out others. The script wasn't designed for spaces and even though function calls are used there are multiple lines that need addressing.
As stated I get it working in one area and it fails in another. I am still working out the most efficient way to code that will work in all areas with out having to rewrite whole blocks of code. It isn't proving easy.
Thus far all attempts have failed even changing out spaces for things like []. It is beginning to look like this feature may have to wait some. It is turning into a major update. We shall see.
from cya.
Okay this is now working in v2.3.5+ with save and keep commands. The mydata command is still in processing and will add more logic later. This hasn't been the most straightforward alternations. I'll let you know when I get more time but for a bit other projects have higher priority. I still need to recode the exclude with spaces too.
I am changing the format to [] for spaces and eliminating \ at least in the quotes. We shall see about the profile names. It is much easier than having to deal with multiple slashes.
At least I know what to do but need more time.
from cya.
This appears to be working 2.3.5+ but needs more testing.
from cya.
Tested on 2.3.5 and it fails for me.
OVERRIDE_BACKUP_DIRECTORIES="/etc/"
BACKUP_DIRECTORIES="/home/dsanroma/directory[]with[]spaces/"
$ cya save
☀ Cover Your Ass(ets) v2.3.5 ☀
ACTION ⯮ Standard Backup
Checking sudo permissions...
EN: EXCLUDE_/etc/
Backing up /etc/ ... complete
EN: EXCLUDE_/home/dsanroma/directory[]with[]spaces/
Backing up /home/dsanroma/directory with spaces/ ...rsync: mkdir "/home/cya/points/3/home/dsanroma/directory with spaces" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(674) [Receiver=3.1.1]
complete
Backing up /initrd.img ... complete
Backing up /initrd.img.old ... complete
Backing up /vmlinuz ... complete
Backing up /vmlinuz.old ... complete
Write out date file ... complete
Update rotation file ... complete
from cya.
I am not surprised.
The reason is because CYA was originally only creating one directory deep. Since you have specified three /home/dsanroma/directory with spaces/ this is failing as /home/ and then inside that /dsanroma/ need to be created first. So of course /directory with spaces/ fails as the parents are missing.
No problem. I'll just add the -p flag to mkdir shortly as that is simple to do.
from cya.
I did briefly look at this however there is a slight issue.
The save and keep commands are really more for system directories. When directories are created they get the owner of root. Which is correct for system directories. I could run mkdir differently but that wouldn't work as desired.
You should stick user files into the mydata command so that they will correctly get the right owner. This is one of the reasons I wrote the mydata command. So one can create the destination directory with the necessary ownership. Then when restoring the correct information will be used.
I could create a check original ownership and if not root change directory to that user but that seems unnecessary when one can use the mydata command.
from cya.
Ok... it makes sense...
I will test it out in a similar way but with system folder with spaces and multiple levels down owned by root.
I will also make deeper tests with mydata
in similar fashion.
from cya.
Did you fix this one?
Some possible fixes w/ single quotes should work:
-
Add single quote (') around the dir name and b/w the double quotes
BACKUP_DIRECTORIES="'/home/dsanroma/directory[]with[]spaces/'" -
In some scrips you may need to add \ or \ before the single quote
BACKUP_DIRECTORIES="'/home/dsanroma/directory[]with[]spaces/'"
or
BACKUP_DIRECTORIES="\'/home/dsanroma/directory[]with[]spaces/\'"
from cya.
Related Issues (20)
- Some "TODO" suggests, notes, recommendations, smells, etc HOT 13
- cya mydata - expand / autocomplete profile names HOT 9
- cya mydata - multiple source directories HOT 9
- missing exclude files from configfile documentation ? HOT 9
- Inconsistent syntax dealing with root directory names with spaces HOT 5
- Avoid ambiguity in what forward slash we are referring to HOT 3
- Wonderful, but inconsistent "Currently Doesn't Exist:" section HOT 3
- Using cya mydata <profilename> with EXCLUDE statements HOT 3
- Roadmap HOT 3
- SANATIZE_VAR in cya script HOT 5
- What if harddisk dies? HOT 4
- Question: Changing cya HOME_DIR HOT 6
- Last Run indicator HOT 6
- Bash Tab Completion HOT 15
- Last Profile Used HOT 3
- rsync unexpected behavior HOT 11
- Show MAX_SAVES value HOT 4
- cya directories show excluded dirs and files HOT 5
- How to specify to exclude a root level directory HOT 7
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 cya.