Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when run sh butgg.sh --setup [: Ubuntu: unexpected operator #1

Closed
mbrother2 opened this issue Nov 16, 2019 · 18 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@mbrother2
Copy link
Owner

Your OS version: Ubuntu 16.04.6
Your issue: Error when run sh butgg.sh --setup
Detail log:
[ 15/11/2019 10:07:11 ] ---
[ 15/11/2019 10:07:12 ] Cheking network...
[ 15/11/2019 10:07:12 ] Connect Github successful
[ 15/11/2019 10:07:12 ] Connect Google successful
[ 15/11/2019 10:07:12 ] Checking OS...
[ 15/11/2019 10:07:12 ] OS supported
[ 15/11/2019 10:07:12 ] Downloading script cron file from github...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6486 100 6486 0 0 16659 0 --:--:-- --:--:-- --:--:-- 16630
butgg.sh: 39: [: Ubuntu: unexpected operator
butgg.sh: 39: [: Ubuntu: unexpected operator
butgg.sh: 1: butgg.sh: md5: not found
butgg.sh: 45: [: fd4ed0c766ca96af93cd15fc1eda4bc6: unexpected operator
[ 15/11/2019 10:07:12 ] -e \e[31m[CHECKS][FAIL]\e[0m Can not verify md5sum for file cron_backup.sh. Exit!
@mbrother2
Copy link
Owner Author

Case of https://github.com/yohukm with Ubuntu 16.04.6

@mbrother2
Copy link
Owner Author

I detected problem. Because Ubuntu system links sh shell to dash shell( https://wiki.ubuntu.com/DashAsBinSh ). I will be commit new version asap.

@mbrother2
Copy link
Owner Author

Hi,

I split the script to support Linux system and BSD system:
For Linux please use commands:

curl -o butgg.bash https://raw.githubusercontent.com/mbrother2/backuptogoogle/master/butgg.bash
bash butgg.bash --setup

For BSD please use commands:

curl -o butgg.sh https://raw.githubusercontent.com/mbrother2/backuptogoogle/master/butgg.sh
sh butgg.sh --setup

Please let me know if you get any trouble.

@GarinZeroOne
Copy link

I get this error when i run bash butgg.bash --setup on ubuntu server 18.04

[CHECKS][FAIL] Can not verify md5 for file butgg.bash. Exit!

@yohukm
Copy link

yohukm commented Nov 16, 2019

thank for update
the script very help

@mbrother2
Copy link
Owner Author

@GarinZeroOne I updated md5 of butgg.bash. Please try again.
@yohukm thank you for your feedback. Please open new issue if you get any trouble.

@qasimmughal0
Copy link

Hi All,
I'm facing an error during verify the GDrive app on google account.
Can anyone guide me on how can I fix that? I'm using windows platform
Google Drive

@mbrother2
Copy link
Owner Author

@qasimmughal0
You must complie gdrive with your Google credential, you can create Google credential here:
https://github.com/mbrother2/backuptogoogle/wiki/Create-own-Google-credential-step-by-step
Then complie gdrive on Windows by PowerShell with tutorial:
prasmussen/gdrive#426

Hmm, If need, I can complie one gdrive bin for your platform, Which Windows OS do you use?

@qasimmughal0
Copy link

@mbrother2
Thanks for your reply.
Yes, I need GDrive for windows platform. I'm using windows server 2012 and 2016.
That'll be great help.

@mbrother2
Copy link
Owner Author

@qasimmughal0
This is gdrive bin I complied on Windows 2012 R2, please try:
gdrive.zip

@qasimmughal0
Copy link

@mbrother2
I've tried now I'm getting a new error during copy files on Google Drive.

Failed to get file: Get https://www.googleapis.com/drive/v3/files/1ShTrMEb9QZY1jsJ17aOHvIva3pApl7zE?alt=json&fields=appP
roperties: oauth2: cannot fetch token: 400 Bad Request
Response: {
"error": "invalid_grant",
"error_description": "Token has been expired or revoked."

@mbrother2
Copy link
Owner Author

@qasimmughal0
Please reset your Google token by remove file token_v2.json and try again.

@qasimmughal0
Copy link

@mbrother2
Can you guide me how can I reset?

@mbrother2
Copy link
Owner Author

@qasimmughal0
You can read here:
prasmussen/gdrive#317

@qasimmughal0
Copy link

@mbrother2
But I don't know where is %appdata%.gdrive\token_v2.json directory in windows.
Can you tell me where it should be in the windows platform?

@mbrother2
Copy link
Owner Author

@qasimmughal0
You can search .gdrive folder on your server. File token_v2.json locate in .gdrive folder

@qasimmughal0
Copy link

@mbrother2
Thanks, I've fixed my issue. It's worked now

@mbrother2
Copy link
Owner Author

Hi all,

I will be close this issue here. Please open new ticket if you get any trouble when use butgg.bash or butgg.sh. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants