Can I remove all the content in the file manager trash bin server wide?
I have a dedicated customer that wants to clean out the trash bin for hundreds of cPanel accounts. Anyway we can do this from the command line with a single code string? Rather than logging into each account to empty the trash folder.
-
just create all usernames in a txt file and create a bash script & execute to trash all accounts. 0 -
find /home/*/.trash -delete 0 -
The command @GOT provides will empty the trash for all accounts on the server, if this is what you want to do it'll work. Otherwise you'd need to loop through the users you want to delete it for. The following UAPI function would be able to remove the trash: UAPI Functions - Fileman::empty_trash - Developer Documentation - cPanel Documentation 0 -
Perfect, thanks! I guess there is no need to use the directory like this? find /home/*/.trash/* -delete I imagine cPanel just replaces the .trash folder when deleted. 0
Please sign in to leave a comment.
Comments
4 comments