Giter Site home page Giter Site logo

Comments (20)

cleverwise avatar cleverwise commented on May 27, 2024

Have you tried putting a back slash?

/home/dsanroma/directory\ with\ spaces/

from cya.

cspaniard avatar cspaniard commented on May 27, 2024

Yes I did... no dice... ;(

from cya.

cleverwise avatar cleverwise commented on May 27, 2024

Okay. Well that needs to be patched and honestly has the highest priority out of all these issues.

from cya.

cspaniard avatar cspaniard commented on May 27, 2024

Makes sense, of course... Bugs first, features later... ;)

I will keep on testing different things and scenarios...

from cya.

cleverwise avatar cleverwise commented on May 27, 2024

All you need to do is try \\

/home/dsanroma/directory\\ with\\ spaces/

from cya.

cleverwise avatar cleverwise commented on May 27, 2024

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.

cspaniard avatar cspaniard commented on May 27, 2024

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.

cleverwise avatar cleverwise commented on May 27, 2024

Yeah I already added it to the configfile information in 2.3.1+ dev/2.4

from cya.

cleverwise avatar cleverwise commented on May 27, 2024

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.

cspaniard avatar cspaniard commented on May 27, 2024

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.

cleverwise avatar cleverwise commented on May 27, 2024

Good catch and a typo. Fixed in 2.3.2.

from cya.

cspaniard avatar cspaniard commented on May 27, 2024

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.

cleverwise avatar cleverwise commented on May 27, 2024

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.

cleverwise avatar cleverwise commented on May 27, 2024

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.

cleverwise avatar cleverwise commented on May 27, 2024

This appears to be working 2.3.5+ but needs more testing.

from cya.

cspaniard avatar cspaniard commented on May 27, 2024

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.

cleverwise avatar cleverwise commented on May 27, 2024

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.

cleverwise avatar cleverwise commented on May 27, 2024

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.

cspaniard avatar cspaniard commented on May 27, 2024

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.

HarriL avatar HarriL commented on May 27, 2024

Did you fix this one?

Some possible fixes w/ single quotes should work:

  1. Add single quote (') around the dir name and b/w the double quotes
    BACKUP_DIRECTORIES="'/home/dsanroma/directory[]with[]spaces/'"

  2. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.