This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Google Apps Script to delete old files and optionally empty folders in Google Drive. | |
* | |
* Settings: | |
* - cutOffDays: Number of days before the current date to consider for file deletion. | |
* - deleteEmptyFolders: Set to true to delete empty directories, false to keep them. | |
* | |
* Instructions: | |
* 1. Ensure "Drive" advanced service is enabled: | |
* - In the Google Apps Script dashboard, click "+ Services" in the sidebar. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This script deletes Gmail email threads older than a set time. | |
* | |
* To schedule this script to run once a week: | |
* 1. In the Google Apps Script dashboard, click on the clock icon on the left sidebar. | |
* 2. Click on the '+' button at the bottom right to add a new trigger. | |
* 3. Set the function to "DeleteOldEmail", the deployment to "Head", and the event source to "Time-driven". | |
* 4. Choose the "Week timer" option and select the day and time you'd like the script to run. | |
* 5. Save the trigger. Ensure that you've granted the necessary permissions for the script to run. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Clean WHMCS Logs | |
* | |
* Based on the script by @linux4me at: | |
* https://whmcs.community/topic/289637-database-cleanup-operations-tbllog_register-and-tblactivitylog/ | |
* | |
* This script deletes records from the WHMCS `tbllog_register` table that are older than the specified date. | |
* This is useful for keeping the database size down because WHMCS adds records every 5 minutes when the cron runs. | |
* |