Code Monkey home page Code Monkey logo

Comments (5)

rafaelmuylaert avatar rafaelmuylaert commented on August 15, 2024

I got it.

Sed escapes the single quotes well, but the script crashes if it finds a back tick.

adding another sed to strip quotes out of the filenames did the job.

| grep "^[ch<>.*][f]|deleting" | sed "s:^\S_\s_::" | sed -ne 's/\d96\d39//gp' | sed "s:(.):if [ -f "\1" ]; then cp --parents "\1" $DOT_DIR/backups/$TIMESTAMP; fi:" | sh || die "BACKUP"

from bitpocket.

torfason avatar torfason commented on August 15, 2024

So am I correct in understanding that the issue was caused by back ticks in
filenames? If so, nice detective work, and some nice sedding ...

If that is the case, and you strip them from the filenames, what happens to
the files then? It seems to me that the "if []" then looks for a filename
without backtick, does not find it, and then does not back it up. Correct?

Nevertheless, if everything else in bitpocket then moves along without
issue, this might still be a candidate for application, since it would move
bitpocket from (a) breaking on back ticks in file names to (b) not backing
files with back ticks in their names up correctly. A note on that issue
should probably be added somewhere in that case.

On Thu, Jan 30, 2014 at 8:23 PM, rafaelmuylaert [email protected]:

I got it.

Sed escapes the single quotes well, but the script crashes if it finds a
back tick.

adding another sed to strip quotes out of the filenames did the job.

| grep "^[ch<>.][f]|deleting" | sed "s:^\S\s::" | sed -ne
's/\d96\d39//gp' | sed "s:(.*):if [ -f "\1" ]; then cp --parents "\1"
$DOT_DIR/backups/$TIMESTAMP; fi:" | sh || die "BACKUP"


Reply to this email directly or view it on GitHubhttps://github.com//issues/45#issuecomment-33729035
.

from bitpocket.

torfason avatar torfason commented on August 15, 2024

Looks very nice!

On Fri, Jan 31, 2014 at 1:04 AM, rafaelmuylaert [email protected]:

this should do it:

rsync -auvzxi --delete --dry-run /home/rafael/rsync/de/
/home/rafael/rsync/para | grep "^[ch<>.][f]|deleting" | sed "s:^\S\s::"
| sed 's:\d96:`:g' | sed "s:(.*):if [ -f "\1" ]; then cp --parents
"\1" /home/rafael/rsync/para/backups; fi:" | sh


Reply to this email directly or view it on GitHubhttps://github.com//issues/45#issuecomment-33753002
.

from bitpocket.

ku1ik avatar ku1ik commented on August 15, 2024

This can be closed too, right?

from bitpocket.

rafaelmuylaert avatar rafaelmuylaert commented on August 15, 2024

Also Yes :D

from bitpocket.

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.