How to move complete site from one location to another using gdrive for heavy files via terminal

Author - Navneet Kashyap

Problem: How to move complete site from one location to another using gdrive for heavy files via terminal.

Solution:

1.  Log on to server where site is hosted via SSH.

2. Make a tar.gz of folder/directory of your site located.

3. Download gdrive in current directory by using below command:

# wget https://github.com/prasmussen/gdrive

4.  # sudo mv gdrive (application) to /usr/local/bin (if you have root access else run directly from current location).

5.  # drive help (to list help file).

6.  # gdrive list ( to list the online google drive contents in terminal).

7.  Above command will display a URL which you have to open in web browser on any system and then login into that account drive which you would like to access then it will provide you Authorization code which you need to copy and use it in terminal and then you can also upload, download and list the contents as well.

8. How to upload a file:

# gdrive upload 
# gdrive upload --parent <encoded gdrive directory-name>

9.  How to download file from gdrive:

# gdrive download <file-name>
# gdrive download <encoded gdrive directory-name>

10. How to list the files of gdrive:

# gdrive list

11. How to make directory in gdrive:

# gdrive mkdir <directory-name>

12. How to share a file or directory of gdrive to everyone:

# gdrive share <file/directory-name>

13.  How to update the existing file:

# gdrive update <encoded gdrive file-name> <file-name>

14.  how to sync directory on gdrive:

# gdrive sync <directory-name> <encoded gdrive directory-name>

15.  how to list content of sync directory:

# gdrive sync content <encoded gdrive directory-name>

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published. Required fields are marked *