Comments (5)
Could you run try it with:
bash -x ./couchdb-backup.sh $args
Should be able to work out where the error is then :) also; which platform
are you on?
from couchdb-dump.
Macbook Air - OSX 10.10.3. Lots of free space.
Here's the output, with sensitive data blanked out:
+ scriptversionnumber=1.1.0
+ '[' x-b = x ']'
+ username=
+ password=
+ backup=false
+ restore=false
+ port=5984
+ OPTIND=1
+ lines=5000
+ attempts=3
+ getopts ':h?H:d:f:u:p:P:l:t:a:V?b?B?r?R?' opt
+ case "$opt" in
+ backup=true
+ getopts ':h?H:d:f:u:p:P:l:t:a:V?b?B?r?R?' opt
+ case "$opt" in
+ url=couchdb
+ getopts ':h?H:d:f:u:p:P:l:t:a:V?b?B?r?R?' opt
+ case "$opt" in
+ db_name=awesomedb
+ getopts ':h?H:d:f:u:p:P:l:t:a:V?b?B?r?R?' opt
+ case "$opt" in
+ file_name=db_dump.json
+ getopts ':h?H:d:f:u:p:P:l:t:a:V?b?B?r?R?' opt
+ case "$opt" in
+ username=KingScooty
+ getopts ':h?H:d:f:u:p:P:l:t:a:V?b?B?r?R?' opt
+ case "$opt" in
+ password=XXX
+ getopts ':h?H:d:f:u:p:P:l:t:a:V?b?B?r?R?' opt
+ shift 11
+ '[' '' = -- ']'
+ '[' '!' x = x ']'
+ '[' true = true ']'
+ '[' false = true ']'
+ '[' true = false ']'
+ '[' xcouchdb = x ']'
+ '[' xawesomedb = x ']'
+ '[' xdb_dump.json = x ']'
+ file_name_orig=db_dump.json
++ uname -a
++ grep -ci darwin
+ '[' '!' 1 = 0 ']'
++ sysctl -n hw.ncpu
+ cores=4
+ '[' '!' x = x ']'
++ expr 4 - 1
+ threads=3
+ case $attempts in
+ true
++ echo couchdb
++ grep -c http
+ '[' '!' 0 = 1 ']'
+ url=http://couchdb
++ egrep -c ':[0-9]*$'
++ echo http://couchdb
+ '[' '!' 0 = 1 ']'
+ url=http://couchdb:5984
+ '[' '!' xKingScooty = x ']'
+ '[' xXXX = x ']'
+ '[' '!' xKingScooty = x ']'
+ '[' '!' xXXX = x ']'
++ echo http://couchdb:5984
++ awk -F/ '{print$1}'
+ httptype=http:
++ echo http://couchdb:5984
++ awk -F/ '{print$3}'
+ urlbase=couchdb:5984
+ url=http://KingScooty:XXX@couchdb:5984
++ echo http://KingScooty:XXX@couchdb:5984
++ grep -ic '^https://'
+ '[' 0 = 1 ']'
+ '[' true = true ']'
+ '[' false = false ']'
+ '[' -f db_dump.json ']'
+ curl -X GET 'http://KingScooty:XXX@couchdb:5984/awesomedb/_all_docs?include_docs=true' -o db_dump.json
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 99k 0 99k 0 0 146k 0 --:--:-- --:--:-- --:--:-- 146k
+ '[' '!' 0 = 0 ']'
++ head -n 1 db_dump.json
++ grep '^{"error'
+ ERR_CHECK=
+ '[' '!' x = x ']'
++ file db_dump.json
++ grep -c CRLF
+ '[' 0 = 1 ']'
+ echo '... INFO: Amending file to make it suitable for Import.'
... INFO: Amending file to make it suitable for Import.
+ echo '... INFO: Stage 1 - Document filtering'
... INFO: Stage 1 - Document filtering
++ du -P -k db_dump.json
++ awk '{print$1}'
+ '[' 100 -ge 256000 ']'
++ wc -l db_dump.json
++ awk '{print$1}'
+ KBreduction=2
++ du -P -k db_dump.json
++ awk '{print$1}'
+ filesize=100
++ expr 100 - 2
+ filesize=98
+ checkdiskspace db_dump.json 98
+ location=db_dump.json
+ KBrequired=98
+ '[' xdb_dump.json = x ']'
+ '[' x98 = x ']'
+ stripdir=db_dump.json
++ df -P -BK db_dump.json
++ tail -n 1
++ awk '{print$4}'
++ sed -e 's/K$//'
df: illegal option -- B
usage: df [-b | -H | -h | -k | -m | -g | -P] [-ailn] [-T type] [-t] [filesystem ...]
+ KBavail=
+ '[' -ge 98 ']'
couchdb-backup.sh: line 74: [: -ge: unary operator expected
+ echo
+ echo '... ERROR: Insufficient Disk Space Available:'
... ERROR: Insufficient Disk Space Available:
+ echo ' * Full Path: db_dump.json'
* Full Path: db_dump.json
+ echo ' * Affected Directory: db_dump.json'
* Affected Directory: db_dump.json
+ echo ' * Space Available: KB'
* Space Available: KB
+ echo ' * Total Space Required: 98 KB'
* Total Space Required: 98 KB
++ expr 98 -
expr: syntax error
+ echo ' * Additional Space Req: KB'
* Additional Space Req: KB
+ echo
+ exit 1
from couchdb-dump.
Seems like a continuation of #20 here; in the checkdiskspace()
function. Should be a simple enough fix.
from couchdb-dump.
Have merged a fix for this into the master branch. Please re-download and test to confirm that this is now working as expected.
Thanks!
from couchdb-dump.
Will close this off for now; I'm pretty certain it's sorted :) feel free to reopen if you find it to still be an issue.
from couchdb-dump.
Related Issues (20)
- Backup / restore all databases? HOT 4
- Stuck at 'Stage 1 - Document filtering' HOT 6
- Taking backup for all revisions HOT 1
- Is it possible to set the password with a environment variable? HOT 4
- ERROR: Curl encountered an issue whilst dumping the database HOT 1
- Backup exits with exitcode 1 in silent mode HOT 1
- can dump all revisions docs HOT 4
- Error when restoring: POST body must include `docs` parameter. HOT 4
- Document update conflict upon restore HOT 3
- couchdb-dump doesn't work with busybox's grep anymore HOT 1
- Backup all databases HOT 9
- Invalid UTF-8 JSON error while restoring large file HOT 5
- Restore backup into non-empty database HOT 1
- Backup does not work with pouchdb-server
- Question: How does the restore handle duplicate data? HOT 1
- compilation_error when attempting to restore database
- CouchDB Reported error, need some advice on how to debug HOT 1
- How can exclude some databases from backup? HOT 1
- Nice to have a 'drop database' option
- Intermittent backup issue HOT 1
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 couchdb-dump.