backuptogoogle | Backup to Google Drive use gdrive | REST library

 by   mbrother2 Shell Version: Current License: MIT

kandi X-RAY | backuptogoogle Summary

kandi X-RAY | backuptogoogle Summary

backuptogoogle is a Shell library typically used in Web Services, REST applications. backuptogoogle has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub, GitLab.

Backup to Google Drive use gdrive
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              backuptogoogle has a low active ecosystem.
              It has 90 star(s) with 23 fork(s). There are 3 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 3 open issues and 17 have been closed. On average issues are closed in 18 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of backuptogoogle is current.

            kandi-Quality Quality

              backuptogoogle has 0 bugs and 0 code smells.

            kandi-Security Security

              backuptogoogle has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              backuptogoogle code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              backuptogoogle is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              backuptogoogle releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of backuptogoogle
            Get all kandi verified functions for this library.

            backuptogoogle Key Features

            No Key Features are available at this moment for backuptogoogle.

            backuptogoogle Examples and Code Snippets

            No Code Snippets are available at this moment for backuptogoogle.

            Community Discussions

            QUESTION

            `Invalid grant` error when cron runs website backup google drive api script
            Asked 2018-Jan-27 at 03:03

            I am trying to take backup of my website`s files and database and upload it to google drive from my website via Google drive Api.

            Followed instructions as per these links - backup files to google drive using php https://www.matthewhipkin.co.uk/codelib/automatically-backing-up-your-web-server-files-to-googledrive-with-php/ and did the following -

            1. downloaded the backupgoogledrive folder from https://github.com/hippy2094/backuptogoogledrive and uploaded that in my public_html/backup folder and renamed backuptogoogle.php as backup/index.php

            2. I created the client ID, client secret and an authCode and put those in the setting.inc along with my MySQL username, password and database name. $homedir was put as /home/myuser/ and $sitedir was set to public_html/

            3. Then, I ran in SSH - php /home/user/backup/index.php

              This ran fine generating a json file and backup for files and database also was found in google drive.

            4. Then, I set up cron job as follows - 5 0 * * 6 /usr/local/bin/php /home/myusername/public_html/backup/index.php

              This should run the script at 00:05 on a saturday but it did NOT run or backup to google drive.

            5. After that, I changed the cron to run every 15 minutes. I noticed that the files and database backups are going to home/myuser folder instead of google drive and the error_log in that folder is giving this error every 15 minutes -

            Fatal error: Uncaught exception 'Google_AuthException' with message 'Error fetching OAuth2 access token, message: 'invalid_grant'' in /home/myuser/public_html/backup/google-api-php-client/src/auth/Google_OAuth2.php:115

            Stack trace:

            #0 /home/myuser/public_html/backup/google-api-php-client/src/Google_Client.php(127): Google_OAuth2->authenticate(Array, '4/SCxgUoxjnbe_0...')

            #1 /home/myuser/public_html/backup/index.php(38): Google_Client->authenticate('4/SCxgUoxjnbe_0...')

            #2 {main} thrown in /home/myuser/public_html/backup/google-api-php-client/src/auth/Google_OAuth2.php on line 115`

            Please note while registering at Google API at https://console.developers.google.com/apis I selected Other option in the Credentials Page and not Web Application because my aim is only to take backup for my site. Also, when I selected the Web Application option and generated the client ID and secret and tried to generate the authCode via url generated in SSH, it would give an error with the SSH generated url. So, the solutions for invalid grant which are mentioned in other posts do not work for me as I do not get option for setting call back url.

            Please tell what I am doing wrong. Why I am able to run the script successfully manually and not via cron ? When I am running the script manually running in SSH. Only problem happens when cron runs.

            Thanks in advance.

            ...

            ANSWER

            Answered 2018-Jan-27 at 03:03

            Found the solutions as follows -

            Put in the file index.php this code -

            Source https://stackoverflow.com/questions/48472079

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install backuptogoogle

            You can download it from GitHub, GitLab.

            Support

            Linux: CentOS, Debian, Ubuntu, openSUSEBSD: FreeBSDCommercial: CloudLinux, SUSE Linux EnterpriseWindows: Build gdrive only
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/mbrother2/backuptogoogle.git

          • CLI

            gh repo clone mbrother2/backuptogoogle

          • sshUrl

            git@github.com:mbrother2/backuptogoogle.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link