July 30th, 2025
𝗬𝗼𝘂𝗿 𝗰𝗶𝗿𝗰𝗹𝗲 𝗼𝗳 𝗶𝗻𝗳𝗹𝘂𝗲𝗻𝗰𝗲 𝘀𝗵𝗮𝗽𝗲𝘀 𝘆𝗼𝘂𝗿 𝘀𝘁𝗮𝗻𝗱𝗮𝗿𝗱𝘀 - 𝗮𝗻𝗱 𝘆𝗼𝘂𝗿 𝗿𝗲𝘀𝘂𝗹𝘁𝘀.
Your circle shapes your results. Discover how high-level masterminds drive sharper strategy, faster growth, and stronger execution.
Set up an automatic Google Drive backup in minutes. Learn how to copy files between Drive folders using a simple Apps Script.
Patrick Flanagan
February 24th, 2025
Worried about losing important documents stored in Google Drive? A simple backup strategy can give you peace of mind—especially if you handle invoices, legal forms, or other critical files. In this tutorial, we’ll show you how to automate backups from one Drive folder to another using a quick Google Apps Script snippet.
folders/
).Example: If the URL is https://drive.google.com/drive/folders/1-AbCdEfGhI
, then 1-AbCdEfGhI
is your folder ID.
Tip: You can also go to script.google.com and create a new script directly.
Paste the following code into the Script Editor, making sure to replace the sourceFolderId and backupFolderId with your actual folder IDs:
function backupDriveFiles() {
// Replace these with your folder IDs
var sourceFolderId = "SOURCE_FOLDER_ID_HERE";
var backupFolderId = "BACKUP_FOLDER_ID_HERE";
var sourceFolder = DriveApp.getFolderById(sourceFolderId);
var backupFolder = DriveApp.getFolderById(backupFolderId);
// Get all files in the source folder
var files = sourceFolder.getFiles();
while (files.hasNext()) {
var file = files.next();
// Make a copy of each file in the backup folder
file.makeCopy(file.getName(), backupFolder);
}
Logger.log("Backup complete!");
}
How It Works
You can run this script manually or set it to run automatically on a daily/weekly basis:
That’s it! You now have a simple backup solution for your Google Drive files using Apps Script. Scheduled backups help ensure you always have extra copies of important documents in case of accidental deletions or overwrites.
Looking for more automation ideas? Get in touch for custom workflows tailored to your business. You’ll free up time and rest easy knowing your files—and your processes—are fully protected.