문제

현재 Google 양식을 사용하여 Google 문서 도구 스프레드 시트에 저장된 정보를 제출할 수 있도록합니다.나는 정기적 인 간격으로 스프레드 시트의 백업을 자동화 할 수 있는지 궁금해하고있었습니다.예를 들어, 매주 금요일 스프레드 시트는 CSV로 내보내거나 이메일로 보내거나 서버의 암호로 보호 된 디렉토리에 저장됩니다.

독서에 감사 드리며 어떤 아이디어가 감사합니다!

도움이 되었습니까?

해결책

Google 문서 도구는 온라인으로 문서를 편집하고 공동 작업하는 데 이상적인 도구입니다. Google 문서 도구가 자동으로 백업 할 수있는 기능을 제공하지는 않지만 Google 문서 도구와 동시에 Dropbox 스토리지를 사용하는 사람들은 해당 솔루션이 있습니다.

해결 방법은 cloudhq (10 $ + / pm) Google 문서 도구와 Dropbox 간에 실시간 동기화를 제공하는 서비스. 예를 들어 사용자가 일부 Google Docs 웹 문서를 편집하는 동안 문서는 Dropbox에서 자동으로 수정됩니다. 즉, CloudHQ 은 Google 문서 도구에서 Dropbox에서 파일을 자동으로 복사합니다.

"nofollow noreferrrer"> CloudHQ Quick Tour에 대한 다음 링크를 제안하고 싶습니다. . CloudHQ 은 Google 크롬 확장을 제공합니다. CloudHQ 크롬 브라우저 확장으로 Google 문서 도구 인터페이스에서 직접 Dropbox 또는 BaseCamp 계정에서 Dropbox 또는 BaseCamp 계정에서 동기화하거나 복제 할 수 있습니다. Extension은 Google 크롬 웹 스토어에서 사용할 수 있습니다.

클라우드 서비스 간의 데이터 동기화에 대한 약간의 팁이나 의견을 제공 할 수 있다면 감사해야합니다.

다른 팁

여기에 해결책이 있습니다 :

  • Google 스프레드 시트의 백업 생성 (Daily / Weekly etc.)
  • Google 드라이브의 주어진 폴더의 Excel 파일 (XLSX)
  • 컴퓨터에 자동으로 동기화하도록 구성 할 수 있습니다

1 단계

Google 드라이브 (예 : 드라이브> 문서> 백업 ")에서 백업 파일의 폴더를 만듭니다. 브라우저에서 열고 URL에서 " 폴더 ID "를 메모하십시오. 예를 들어, 다음 URL의 폴더 ID는 1234abcdefgh_98765ijklmnopqrs_0XY

입니다.

https://drive.google.com/drive/ u / 0 / folders / 1234abcdefgh_98765ijklmnopqrs_0xy? ths= true

2 단계

자동으로 백업하려는 Google 스프레드 시트를 엽니 다. 맨 위로 메뉴에서 "도구"> "스크립트 편집기"를 선택하십시오. 열리는 새 창에서 기본 코드를 아래 코드로 바꾸고 다음을 수행하십시오.

  • Advanced Drive Service 에서 아직 : 맨 위로 메뉴에서 "자원"> "고급 Google 서비스 ..."> "Drive API"> "켜짐"
  • xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • 라인의 백업 폴더 ID로 var backupFolder = ...를 백업 폴더 ID로 바꾸어 폴더 ID 을 업데이트합니다.
// function to backup the current Spreadsheet as an Excel file (XLSX) in a given folder
// -- requires "Advanced Drive Service" which must be enabled in "Resources" > "Advanced Google services..." > "Drive API" > toggle "ON"
function backupSheet() {
  // UPDATE THE FOLDER ID for e.g. "My Drive > Docs > Backups"
  var backupFolder = DriveApp.getFolderById("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var spreadsheetId = spreadsheet.getId();
  var file = Drive.Files.get(spreadsheetId);
  var url = file.exportLinks[MimeType.MICROSOFT_EXCEL];
  var token = ScriptApp.getOAuthToken();
  var options = { headers: { Authorization: "Bearer " + token } };
  var response = UrlFetchApp.fetch(url, options);
  var doc = response.getBlob();
  var backupDate = Utilities.formatDate(new Date(), "GMT", "yyyy-MM-dd' 'HH-mm-ss");
  var backupName = spreadsheet.getName() + ".backup " + backupDate + ".xlsx";
  var tempFile = DriveApp.createFile(doc).setName(backupName);
  tempFile.makeCopy(backupName, backupFolder);
  tempFile.setTrashed(true);
}
.

스크립트를 테스트하려면 코드 위의 " 실행 아이콘을 클릭하십시오. 이렇게하면 구성한 백업 폴더에 스프레드 시트의 백업 Excel 파일이 생성됩니다 (이전에 언급 한 폴더 ID를 기반으로 함).

3 단계

save 맨 위 메뉴에서 "파일"> "저장"을 선택한 다음 코드 위의 " 트리거 + 트리거 "(오른쪽 하단 모서리에 있음)를 클릭하십시오. 자동 백업의 실행을 계획 할 수있는 "백업 시트에 대한 트리거 추가"라는 오버레이가 표시되어야합니다. 예를 들어 월요일에 매주마다 실행되도록하려면 다음 설정을 구성해야합니다.

  • 실행할 기능 선택 : 백업 시트
  • 실행 해야하는 배포를 선택하십시오 : head
  • 이벤트 소스 선택 : 시간 - 주도
  • TIMET 유형의 트리거 유형을 선택하십시오 : 주 타이머
  • 선택 요일 : 매주 월요일

저장 트리거를 구성 할 때 트리거. Excel Backups는 이제 Google 드라이브의 원하는 폴더에서 자동으로 생성됩니다.

4 단계

마지막으로 "NoReferRer"> 컴퓨터의 Google에서 백업 및 동기화 (아직하지 않은 경우) Google 드라이브 계정에서 백업 폴더를 동기화하도록 구성하고 "기본 설정"> "Google 드라이브"> "이 컴퓨터로 드라이브 동기화"를 사용하고 백업 폴더가 있는지 확인하십시오. 동기화중인 폴더 중.

이제 앱이 자동으로 Google 스프레드 시트의 Excel 백업을 다운로드하여 오프라인 즐거움을 위해!

Two solutions that don't involve a for-pay subscription: 1) write a script or short app (pick your language) that exports a Google Sheet using the Google Drive API as CSV. Why the Drive API? The Sheets API is for spreadsheet-oriented functionality, i.e., data formatting, column resize, creating charts, cell validation, etc., while the Drive API is for file-oriented functionality, i.e., import/export.

If you do Python, here's a complete example which you can run as a cron job on your server or if app-hosting on Google App Engine. If you don't, you can use it as pseudocode and pick any language supported by the Google APIs Client Libraries. Here's core piece of code from that example (assume the most current Sheet named 'inventory'):

FILENAME = 'inventory'
SRC_MIMETYPE = 'application/vnd.google-apps.spreadsheet'
DST_MIMETYPE = 'text/csv'

files = DRIVE.files().list(
    q='name="%s" and mimeType="%s"' % (FILENAME, SRC_MIMETYPE),
    orderBy='modifiedTime desc,name').execute().get('files', [])

if files:
    fn = '%s.csv' % os.path.splitext(files[0]['name'].replace(' ', '_'))[0]
    print('Exporting "%s" as "%s"... ' % (files[0]['name'], fn), end='')
    data = DRIVE.files().export(fileId=files[0]['id'], mimeType=DST_MIMETYPE).execute()
    if data:
        with open(fn, 'wb') as f:
            f.write(data)
        print('DONE')

If your Sheet is large, you may have to export it in chunks -- see this page on how to do that. You can also email the file contents to yourself with the Gmail API. If you're generally new to Google APIs, I have a (somewhat dated but) user-friendly intro video for you. (There are 2 videos after that maybe useful too.)

2) The other solution is for those who are "allergic" to using APIs, and that alternative is Google Apps Script, Javascript outside of the browser. Like Node, it runs server-side but on Google's servers. With Apps Script, you can use DriveApp or the advanced Drive service to access your Sheet, then use MailApp or GmailApp to email it to yourself, or use the UrlFetch service to send it to some server of your choosing. To run it at a normal interval, you'll need to create a script as a time-driven installable trigger. In either case, you don't need to host+execute your app yourself.

ps. The latest Drive API version is v3, but if you access Drive from Apps Script, it uses v2 (not deprecated yet).

Google docs is a free tool that allows users to automatically save and collaborate any data in real-time. It does not however have a built-in feature for secure google docs backup nor automatic real-time backup.

Google have stated officially in their terms of service that:

Google, and Google’s suppliers and distributors, will not be responsible for lost profits, revenues, or data, financial losses or indirect, special, consequential, exemplary, or punitive damages.

Their waving of liability is applicable not just for personal use but also business use:

If you are using our Services on behalf of a business, that business accepts these terms. It will hold harmless and indemnify Google and its affiliates… including any liability or expense arising from claims, losses, damages, suits, judgments, litigation costs and attorneys’ fees.

Today there are other options other than paying to sync to Dropbox for google docs backup automation. Your decision on how to automate your google docs backup depends on a few factors:

  1. How sensitive your data is, and whether it’s for personal or business use i.e- How liable you’ll need to be in case of data loss or a security breach.

  2. Whether you have the dev knowledge to code a script or app using any of the methods outlined by wescpy previously in full detail:

a) using the Google drive API that exports google sheets automatically b) using Python to run a cron job on your server to export a google sheet spreadsheet as CSV or c) write a non-API Javascript that runs outside your browser using the Google apps script

If you require full security and data protection, and opt for a no-pay subscription- automated google docs backup solution, suffice to say you need to be sure your code is reliable and provides the security/encryption your project requires.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top