Add manual archive/ directory cleaning option
For the shared hosting installation, it is impossible or difficult to setup a cron process, and sometimes space is missing due to the massive use of the archive/ directory for temporary files.
Develop a script that removes all contents from the archive/ directory, except .htaccess, through PHP commands (unlink and rmmdir - there are wrapper functions for these in the Chamilo libraries) to avoid portability issues for Windows servers.
Place a link in the "Portal" block in main/admin/index.php which leads to a new dedicated page:
$ArchiveDirCleanup = "Archive directory cleanup";
$ArchiveDirCleanupDescr = "Chamilo keeps a copy of most of the temporary files it generates (for backups, exports, copies, etc) into its archive/ directory. After a while, this can add up to a very large amount of disk space being used for nothing. Click the button below to clean your archive directory up. This operation should be automated by a cron process, but if this is not possible, you can come to this page regularly to remove all temporary files from the directory.";
$ArchiveDirCleanupProceedButton = "Proceed with cleanup";
$ArchiveDirCleanupSucceeded = "The archive/ directory cleanup has been executed successfully.";
$ArchiveDirCleanupFailed = "For some reason, the archive/ directory could not be cleaned up. Please clean it up by manually connecting to the server and deleting the contents of the chamilo/archive/ directory, except the .htaccess file.";
The new file, main/admin/archive_cleanup.php has to be authorized for admins only (api_protect_admin_script()) and be accessible only on the root portal (in case of multi-urls).
Upon clicking the button, the action is executed immediately, the user is sent back to main/admin/index.php and the confirmation (or error) message appears on top of the page.
Updated by Julio Montoya almost 8 years ago
- Status changed from Assigned to Needs testing
- Assignee deleted (
- % Done changed from 0 to 70