

Zipping the backup files ensures that they don't clutter up the recent activity list for Docs/Sheets/Slides.

For each file, both an Office file (docx/xlsx/pptx) and a PDF are generated, and combined into a zip file that's placed in the backup folder.Remove the file.getOwner() check from the backupAll method if you want to change that. By default, only files that you own (as opposed to files others have shared with you) will be backed up.Replace INSERT_FOLDER_ID_HERE with the ID of the folder you want backups to be placed in.Ĭreate a trigger to run the backupAll function if you want to do this on a schedule (e.g. Google Apps Script that exports all your Google Docs/Sheets/Slides into docx/xlsx/pptx files and PDFs into a folder in your Google Drive.įor more info and step-by-step setup instructions, see here:

Update: I now use a slightly different version of this script, which creates a single zip file instead of one per document, and puts a timestamp in the filename rather than overwriting the previous backup file.
