Deleting old files

The following command line script can be used for deleting old files from users home folders.

php cron/delete_old_files.php  2592000 admin confirm

2592000 is 30 days in seconds, admin is the username of the account that is being cleaned and confirm is needed for executing the task. If confirm is omitted then the command will only simulate the action, showing you what will happen without actually deleting the files. If the username is omitted, the process will run for all user accounts in the system. 2592000 is the smallest value you can use, preventing you from deleting files younger than 30 days.

Important note: the date used for determining a file's age is the “modified” date, not the “created” date. If you have files created a long time ago, but were recently modified, they will not be deleted. For any other desired behavior, the file “system/modules/fileman/sections/cli/php/delete_old_files.php” is freely editable.

Attached Files
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Name
Email
Security Code Security Code
Related Articles RSS Feed
Resetting the FileRun superuser password
Viewed 4211 times since Wed, Nov 22, 2017
Installing updates
Viewed 2007 times since Fri, Mar 7, 2014
Upgrading to PHP 5.5 or 5.6
Viewed 2855 times since Wed, Nov 22, 2017
Backup
Viewed 2787 times since Fri, Mar 7, 2014
Upgrading to PHP 5.4
Viewed 2526 times since Fri, Mar 7, 2014
Migrating to another server
Viewed 2084 times since Fri, Mar 7, 2014
Upgrading PHP to version 7
Viewed 1817 times since Wed, Nov 22, 2017
Changing the MySQL connection information
Viewed 1917 times since Wed, Nov 22, 2017
ZGL to ionCube
Viewed 2348 times since Fri, Mar 7, 2014
MENU