Manage cookies that are used for advertising, such as ad personalization, remarketing, and ad effectiveness analysis.
2.12.9. Automatic catalog cleanup
Important points:
- Warning! Do not specify a path without
~/at the beginning or in the form of/*, as this will delete absolutely all files of all sites on the hosting account. - To disable recursion in the
rmutility, do not specify the-rkey; leave only-f. - To disable recursion when using the
findutility, specify the-maxdepth 1key directly after specifying the path.
To automatically clean up the directory, you can create a cron job with commands to delete files:
- Delete all files and subdirectories in a specific directory:
/bin/rm -rf ~/example.com/www/tmp/*Instead of
example.com/www/tmp/, specify the full path to the directory whose contents you want to delete. - Delete all files with a specific extension in the directory and all its subdirectories:
/bin/rm -rf ~/example.com/www/tmp/*.tmpInstead of
.tmp, specify the desired file extension to be deleted. - Delete all files older than a certain number of days in the specific directory:
/bin/find ~/example.com/www/tmp/ -type f -mtime +30 -exec rm -rf {} \;Instead of
30, specify the number of days that the file should be stored. - Delete all files except one:
/bin/find ~/example.com/www/tmp/ -type f ! -name 'index.php' -deleteTo delete all files except those with a specific extension, replace
index.phpwith*.php. In this case, all files except those with the extension.phpwill be deleted from the directory.