Google Drive can copy a file on a schedule through an Apps Script project and a time-driven trigger. Choose the source file and destination folder, check that one manual copy works, then add the timer to repeat it each day.
This example saves a dated snapshot each day without replacing the original. It suits a file you own in My Drive. It isn't a complete backup of your account, and it doesn't automatically respond the instant someone uploads a file.
In this guide
Choose the file and a separate destination folder
Decide which file needs the snapshot, then create a destination folder in My Drive. Keep the example small at first: one source file and one folder make it easy to check that the automation does exactly what you intended.
Open the source file and copy its ID from the address bar. For a Google document, it is the part between /d/ and the next slash. A Drive file URL can use the same pattern; don't copy the whole web address into the code.
In Drive, open your chosen destination folder. Its ID is the part after /folders/, before any question mark and extra URL parameters. The script uses those IDs to find your source file and save each copy in the right folder.

Choose a private folder you control. People with access to that folder can have access to the copies too, so check who can access the folder before sending snapshots into a shared location.
The Drive folder-transfer guide covers moving existing files separately. This automation creates additional copies; it doesn't move your source or reorganize the rest of My Drive.
Create the script project and add the copy function
Visit https://script.google.com on your computer. Sign in with the source file's owner account, then click New project. Give the project a useful name, such as Daily file snapshot.
Google says standalone projects let you save code separately from a document. The account running the script needs access to your source file and output folder.
Replace the starter function with this code. Put the two IDs inside the quoted placeholders, leaving the surrounding quotation marks in place:
function saveDailySnapshot() {
const fileId = 'PASTE_FILE_ID';
const folderId = 'PASTE_FOLDER_ID';
const file = DriveApp.getFileById(fileId);
const folder = DriveApp.getFolderById(folderId);
const stamp = Utilities.formatDate(
new Date(),
Session.getScriptTimeZone(),
'yyyy-MM-dd_HH-mm-ss'
);
const copy = file.makeCopy(
stamp + ' - ' + file.getName(),
folder
);
console.log(copy.getUrl());
}
The function finds the file and folder, makes a timestamp using the project's time zone, then creates a named copy. The final line writes the new copy's URL to the log so you can open it after a manual run.
The Drive file reference describes makeCopy(name, destination). It creates another file, but you shouldn't expect it to keep the source's complete revision history or all its sharing settings.
Use this example with My Drive. Shared drives need different tools; check the advanced Drive service for those. This personal-file example isn't an organization-wide shared-drive backup.
Run once and approve only the intended project
Save the project, select saveDailySnapshot in the function selector, and click Run. The first run can ask you to review permissions and choose an account before the script can use Drive.
Read the permissions for the project you just created. The permissions can grant broader access than this short function needs. If the consent screen belongs to an unfamiliar project, stop and return to your own editor.
After a successful run, visit the output folder in Drive. A new file should have a timestamp followed by the source name. Open the saved copy and compare a recent edit with the original.
The execution log should also contain the copy's link. Fix any permission or missing-file error before adding a schedule. Confirm the IDs, account, source access, and destination access, then run the function again.
I'd complete that manual check before creating the trigger. It keeps a simple ID mistake from becoming a recurring failure that arrives by email each morning.
Add the time-driven trigger
In the editor's left navigation, select Triggers. Click Add Trigger at the lower right. Choose saveDailySnapshot as the function and select Time-driven as the event source.

Under Select type of time based trigger, choose Day timer. Pick a time window, then click Save. Check the project's time zone in Project Settings so the schedule and timestamp match the day you intended.
A time-driven trigger runs on Google's servers, so your laptop doesn't need to remain open. A daily trigger can run within your selected time window rather than at an exact minute.
The installable trigger guide also explains that a trigger runs under the account that created it. Sharing the script doesn't make the trigger run under the account of whoever opens the project next.
This timer copies the selected file. Apps Script doesn't provide a general Drive-file-upload trigger in the same way it provides certain spreadsheet or form events. If you need it to react to uploads, you'll need a different setup.
Check the next run and stop unwanted copies
After the scheduled window, open Executions in the script editor. Check whether the function completed, then open the destination folder and inspect its newest copy. If a run is marked failed, open it and read the error before retrying.
Failure notifications can arrive by email. Common things to check are a deleted source file, lost access, a full Drive account, or a service quota. Apps Script quotas vary by account and can stop an execution.
Each successful run creates another copy, including manual retries. Keep an eye on storage and choose a cleanup schedule for old snapshots. This code doesn't delete earlier copies or skip days when the original didn't change.
For the wider limits of file copying and synchronization, read the Google Drive backup guide. A snapshot folder helps you keep copies, but you'll need a fuller plan to recover everything.
Stop the automation in Triggers: open its menu and choose Delete trigger. Existing copies stay in the folder. A Workspace administrator can review policies when an organization blocks script creation or consent.
The Short Version
Choose a source file and private destination, create the Apps Script project, and verify one manual copy. Add a time-driven trigger afterward, then check Executions and the saved file. Remove the trigger when copies are no longer needed.
Checked December 4, 2026.







