This tutorial demonstrates how to use Google Apps Script to:
-
Create copies of the Google Sheet in the desired destination folder automatically at set intervals.
-
Append the time stamp with each backup file's name.
-
Adjust time trigger for backing up every day/hour/minute.
Hi estebanthi,
I created a new script and pasted your code in it, added 2 file-id's and the id of the google drive root folder, but when I run the code I get the following error:
Exception: Unexpected error while getting the method or property getFileById on object DriveApp.
makeCopy @ Backups.gs:15
(anoniem) @ Backups.gs:10
run @ Backups.gs:10
I suspect that I have made a slight error in the file ID, but it might be something else.
Am I correct in assuming, that the file ID of a google sheet is found in the url of the sheet between the following pieces?:
https://docs.google.com/spreadsheets/d/ FILE-ID-HERE /edit#gid=XXXXXXXXX
If I'm right about this assumption, could you tell me what else might be causing the error?