Method 1: Automatically delete old Google Drive files
This straightforward approach uses Make to identify and permanently delete Google Drive files that meet your specified criteria, such as files not modified within a certain timeframe. It's ideal when you're certain about the files you want to remove and don't need a recovery option.
The process involves creating a simple two-module scenario in Make that first searches for qualifying files, then deletes them immediately. This method helps maintain your Google Drive storage efficiently without manual intervention.
1. Set up the Make scenario and the first Google Drive module
Begin by creating a new scenario in Make and adding the Google Drive "Search for Files/Folders" module. Connect it to your Google account and configure the settings to identify files based on your criteria. For this tutorial, we're targeting files not modified in the last six months.
Key configuration settings include selecting your target Drive and folder, setting the search query to look for files modified before your cutoff date, and specifying whether to include subfolders in the search. The query uses Google Drive's search syntax with Make's date functions to calculate the timeframe dynamically.
2. Delete your old Google Drive files
Add the Google Drive "Delete a File/Folder" module as the second step in your scenario. Connect it to the same Google account and configure it to receive file IDs from the search module. This creates a direct pipeline where files identified by the search are immediately deleted.
The module requires minimal configuration since it inherits the file selection from the previous step. Importantly, it will delete both files and folders that match your search criteria, despite the "File" setting name, so ensure your search parameters are accurate.
3. Test and activate your scenario
Before running your scenario on all qualifying files, test it carefully on a single, non-essential file. Use the "Run this module only" feature on the search module to verify it identifies the correct files, then add that specific file to your query for a targeted test run.
After confirming the scenario works correctly, remove the single-file restriction and schedule regular runs. Make allows setting the frequency that matches your needs, whether daily, weekly, or monthly maintenance. Consider starting with less frequent runs until you're confident in the results.
Pro tip: Always test automation scenarios that delete data on a single, non-critical file first. This prevents accidental mass deletion of important files during setup.
Method 2: Automatically send old Google Drive files to Trash
This alternative approach provides a safety net by moving files to Trash instead of deleting them permanently. Files remain recoverable for 30 days, giving you time to restore anything deleted accidentally. We'll enhance this method with notifications about moved files.
The scenario follows a similar structure to Method 1 but replaces the deletion module with a "Move to Trash" function and adds components to track and notify about the affected files. This method is ideal when you want oversight before permanent deletion.
1. Create a new Make scenario and add the first Google Drive module
Start by creating a new scenario with the same Google Drive "Search for Files/Folders" module configured identically to Method 1. The same search parameters apply since we're targeting the same files, just handling them differently in the next steps.
This consistency between methods makes it easy to switch approaches if you change your mind later. You can even create both scenarios and run them alternately, comparing results before committing to one method.
2. Add the second module to move your old Google Drive files to Trash
Replace the deletion module with Google Drive's "Move a File/Folder to Trash" module. Configure it similarly by connecting to your Google account and mapping the file IDs from the search module. This creates the same automated workflow but with the safety of the Trash buffer.
The module configuration is nearly identical to the deletion version, maintaining simplicity while changing the destructive action to a reversible one. This demonstrates how small changes in automation can significantly impact risk management.
3. Compile a list of the Google Drive files that have been moved to Trash
Add a Text Aggregator module to create a readable list of all files moved to Trash. Configure it to receive file names from the move operation and format them clearly with separators between items. This list becomes valuable for tracking and verification purposes.
The aggregator helps transform raw data into human-readable information. You can customize the formatting to match your preferences, such as bullet points or numbered lists, making the output easier to review at a glance.
4. Add a filter in between the two Google Drive modules
Insert a filter between the search and move modules to prevent errors when no files are found. Configure it to check for the existence of file IDs before proceeding, ensuring the scenario only continues when there's actual work to do.
This quality-of-life improvement makes the scenario more robust by handling empty results gracefully. It's particularly useful for scheduled runs where you might not always have files meeting your criteria.
5. Send yourself the list of the Google Drive files that have been moved to Trash
Complete the scenario by adding a notification module (like Slack or email) that sends you the aggregated list of moved files. This creates an audit trail and allows you to review what was moved to Trash after each run.
The notification serves both as a verification mechanism and a safety feature. If you spot any files that shouldn't have been moved, you have 30 days to restore them from Trash before permanent deletion.
Pro tip: Combine both methods by running the Trash method regularly (e.g., weekly) and the deletion method monthly to clear files that have been in Trash for 30 days. This creates a balanced approach to automated file management.