Code Monkey home page Code Monkey logo

Comments (5)

dalgibbard avatar dalgibbard commented on July 4, 2024

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.

KingScooty avatar KingScooty commented on July 4, 2024

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.

dalgibbard avatar dalgibbard commented on July 4, 2024

Seems like a continuation of #20 here; in the checkdiskspace() function. Should be a simple enough fix.

from couchdb-dump.

dalgibbard avatar dalgibbard commented on July 4, 2024

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.

dalgibbard avatar dalgibbard commented on July 4, 2024

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)

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.