Comments (5)
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.
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.
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.
This can be closed too, right?
from bitpocket.
Also Yes :D
from bitpocket.
Related Issues (20)
- Editing .bitpocket/exclude results in unexpeced deletions & data loss HOT 4
- Mountain Lion issues HOT 17
- can rsync daemon be used?
- is bitpocket still maintained ? HOT 5
- export LC_ALL=C makes script not work properly with international characters HOT 4
- soft links lost on sync
- slave's symlinks deleted on sync HOT 4
- not working if shell is not bash
- server/master data not backed up before deletion HOT 2
- Space in remote path not handled HOT 5
- OSX compatibility issues - El Capitan HOT 4
- New maintainer(s) needed
- Syntax error on old master directory HOT 2
- bitsync fail on backup HOT 5
- Folder synced as empty and cannot find info in the git backups HOT 2
- Interest in fixing shellcheck warnings? HOT 1
- How does bitpocket distinguish between delete/create? HOT 1
- Two different configs? HOT 1
- Syncing local directories with spaces in their names HOT 3
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 bitpocket.