Skip to content

Space parameter doesn't working #605

Description

@GustavoPicoloto

I use dropbox_uploader.sh in a crontab to do some daily backups in my personal website. Since May 16 the "space" is not working, as below:

$ ~/dropbox/dropbox_uploader.sh space
Dropbox Uploader v1.0

 > Getting space usage info... /home/myuser/dropbox/dropbox_uploader.sh: line 911: let: quota_mb=/1024/1024: syntax error: operand expected (error token is "/1024/1024")


Quota:	 Mb
/home/myuser/dropbox/dropbox_uploader.sh: line 915: let: used_mb=/1024/1024: syntax error: operand expected (error token is "/1024/1024")
Used:	 Mb
Free:	0 Mb

I don't know if it's just me, but I ran the script in debug mode and I could check that the response received from api is a little different than expected, it doesn't have a space after "allocated:" and after "used:". I fixed for me by editing the script and removing the space in lines 910 and 914:

From:
quota=$(sed -n 's/.*"allocated": \([0-9]*\).*/\1/p' "$RESPONSE_FILE")
To:
quota=$(sed -n 's/.*"allocated":\([0-9]*\).*/\1/p' "$RESPONSE_FILE")

And from:
used=$(sed -n 's/.*"used": \([0-9]*\).*/\1/p' "$RESPONSE_FILE")
To:
used=$(sed -n 's/.*"used":\([0-9]*\).*/\1/p' "$RESPONSE_FILE")

Hopes that this helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions