Archiving Google Drive files older than a specified number of days can help you stay organized, reduce clutter, and improve overall productivity. Google Drive does not have a built-in archiving feature with automatic file management by date, but with a combination of manual steps and Google Apps Script, you can automate this task effectively.
Why Archive Old Files in Google Drive?
As digital storage expands, so does digital clutter. Many users store hundreds or even thousands of files over time, and a significant portion of these may no longer be actively needed. Archiving files that haven’t been accessed or modified in X number of days helps:
-
Maintain a clean and efficient workspace
-
Improve search performance within Google Drive
-
Reduce cognitive overload when browsing folders
-
Prepare for compliance and backup needs
-
Prevent accidental deletions of important but dormant files
How Google Drive Handles File Metadata
To automate archiving, it’s essential to understand the metadata Google Drive tracks:
-
Last modified date: When the file was last edited
-
Last viewed date: When someone last accessed the file
-
Created date: When the file was first uploaded or created
The modifiedDate
is the most commonly used property when filtering files for automation.
Manual Archiving Workflow
Before diving into automation, here’s a simple manual method:
-
Sort Files by Last Modified Date
-
Open Google Drive
-
Switch to List View
-
Click on the column header “Last modified” to sort files
-
-
Select Files Older Than X Days
-
Manually identify files that are older than your threshold (e.g., 90 days)
-
-
Create an Archive Folder
-
Create a folder named “Archive – [Month-Year]”
-
-
Move Files
-
Drag and drop selected files into the archive folder
-
While effective, this process can be time-consuming and subjective. Automating the task provides consistency and saves time.
Automating with Google Apps Script
You can create a Google Apps Script to move files older than X days into an archive folder. Here’s a step-by-step guide:
Step 1: Create the Archive Folder
-
Go to your Google Drive
-
Create a new folder named
Archive
Step 2: Write the Google Apps Script
-
Click New project
-
Paste the following script:
Step 3: Run and Authorize the Script
-
Click the play (▶️) button beside
archiveOldFiles()
-
Authorize the script with your Google account
-
It will now move all files older than X days into the
Archive
folder
Optional: Schedule the Script
To run this automatically:
-
Click on the clock icon in Apps Script (Triggers)
-
Add a new trigger for
archiveOldFiles
-
Choose a frequency (e.g., daily, weekly)
Filtering Files from Specific Folders
To only archive files from a certain folder:
Replace this line:
With:
To get the Folder ID:
-
Open the folder in Drive
-
Copy the alphanumeric ID from the URL
Use Google Workspace Admin Tools (For Organizations)
If you’re a Google Workspace admin, you can use Google Vault or third-party tools like:
-
SysCloud
-
Spinbackup
-
Afi.ai
These platforms offer automatic backup and archiving of Google Drive content with policy-based automation, including aging policies.
Using Third-Party Automation Tools
Zapier + Google Drive
You can create a Zap that:
-
Triggers on file updates
-
Checks the age of the file
-
Moves or copies it to an archive folder
Make (formerly Integromat)
Similar to Zapier but offers more complex scenarios. You can:
-
Search for files older than X days
-
Move them to a new folder
-
Notify users via email
Best Practices for Archiving
-
Use Naming Conventions: Tag folders or files by month/year for easy tracking.
-
Backup Before Archiving: Always maintain a backup, especially if the archive will be moved to external storage.
-
Regular Reviews: Schedule reviews of archived content to ensure relevance.
-
Access Controls: Limit edit/delete permissions on archived folders.
Limitations and Considerations
-
Google Apps Script quotas may limit the number of files processed in one run
-
Scripts do not detect shared drive files unless explicitly coded
-
DriveApp can’t access file view history — only the last modified timestamp
-
Large numbers of files may slow down script execution; paginate when necessary
Conclusion
Archiving Google Drive files older than X days is essential for maintaining a tidy and manageable digital workspace. While Google Drive doesn’t offer native time-based archiving, using Google Apps Script or third-party automation tools can bridge this gap effectively. By implementing automated archiving workflows, you ensure your Drive remains clutter-free, organized, and efficient over time.
Leave a Reply