New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
clean your cPanel server and adjust user's files permission
hello
1- To clean your server :
note : this command will remove all .gz files stored in /home
rm -rf /home/*.gz
(be careful with that)
note : this command will Empty cPanel users trash and remove all backup files created by cpanel user
rm -rfv /home/*/.trash;rm -rfv /home/*/backup*
note : this command will remove all backup files created by cpanel user and stores under public_html
rm -rfv /home/*/public_html/backup*
note : this command will remove all backup files created by server admin and stored under user home dir
rm -rfv /home/*/cpmove*
2- To adjust user's files permission
/scripts/enablefileprotect
/scripts/chownpublichtmls
Thanked by 1VPSSimon
Comments
rm -rf /home/*.gz
what? no!
to remove any .gz backup files in /home
oh man...
So you're just removing backups from clients?
This is mainly done when alot of clients have multiple backups an have of them now redundent as months old, So cleaning old backups is very very useful to claw back disk space. Although might seem counter-productive, Its simple to -rerun fresh backups or just do cleanup once every 6months just an hour before crons for backups runs.
That way clients still have backups. - There should be no reason a client would want backups from 6 months ago, Clients prefer recent backups not outdated archives.
in cPanel servers usually backup stored in /backup/cpbackup
This is true but i think some functions do store in /home/ as ive personally cleaned a clients vps recently which had alot of backups in /home/ But also contained backups for SQL within /home/$username
So the above commands wouldn't fully clean But would help clean up majority. I wouldn't personally mess with cpbackup folder leave cpanel to do rotation an clean on that. Just ones outside normal cpanel cleanups i.e home dir.
The commands are safe to remove user created backups.
Very Nice Commands
are you allow to edit post and insert your command ?
I prefer
rm -rf * /home/*.gz.backup
kidding
double post ------------
Disagree!!!!!!
This command is dangerous!!!
rm -rfv /home//public_html/backup
can remove any files or directories which name starts "backup" which i dont think is wanted! even serious client files can be named that way