Google Apps Script to backup Google Calendar into Google Drive.
The data is saved in iCalendar format with an extension of .ics
.
main.js
webapi.js
index.html
3. Store the Secret Address1 of Google Calendar.
- Deploy the GAS project as a web app.
- Open the web app in your browser.
- Enter the Secret Address of Google Calendar, and submit it.
Submitted secret address is stored in User Properties2 of the GAS project.
User Properties can be accessed only by the user, so your secret is safe.
Install GAS trigger to run backup task periodically. main
function must be specified in the trigger.
Defined as a constant BACKUP_FOLDER_PATH
in main.gs
.
Modify the constant if you want to change the folder.
Generated according to the datetime when the backup run.
For example, if backup run at 14:59:30 on October 18, 2021, the file name would be backup_calendar_20211018145930.ics
.
File name can also be changed with the constants defined in main.gs
.
By default, expilation of backup files is 30 days, and expired files will be trashed.
Expilation days can also be changed with the constant defined in main.gs
.
MIT License.
Send a direct message to Higama-ya's twitter account: @higama_ya