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
Installing updates
Viewed 1180 times since Fri, Mar 7, 2014
ZGL to ionCube
Viewed 1505 times since Fri, Mar 7, 2014
Upgrading to PHP 5.5 or 5.6
Viewed 1974 times since Wed, Nov 22, 2017
Backup
Viewed 1507 times since Fri, Mar 7, 2014
Upgrading to PHP 5.4
Viewed 1501 times since Fri, Mar 7, 2014
Migrating to another server
Viewed 1249 times since Fri, Mar 7, 2014
Upgrading PHP to version 7
Viewed 926 times since Wed, Nov 22, 2017
Changing the MySQL connection information
Viewed 956 times since Wed, Nov 22, 2017
Resetting the FileRun superuser password
Viewed 3052 times since Wed, Nov 22, 2017
MENU