Skip to content

Instantly share code, notes, and snippets.

@hasnhasan
Created January 16, 2019 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hasnhasan/e82eb31a4c8bd976dffc08a999700020 to your computer and use it in GitHub Desktop.
Save hasnhasan/e82eb31a4c8bd976dffc08a999700020 to your computer and use it in GitHub Desktop.
server bakımı
1 kullanılmayan veri tabanlarını sil
2 error logları sil
3 yüksek mailleri sil
4 tüm resimleri sıkıştır
5 kullanılmayan dosyaları temizle
# Sunucudaki Resimleri optimize etme
cd /home/
find -type f -name "*.jp*g" -exec jpegoptim --strip-all --max=60 {} \;
find -type f -name "*.png" -exec optipng -o2 -strip all {} \;
# Genel Temizlik
yum clean all;
locate .pureftpd-upload | xargs rm -fv;
rm -fv /home/*/tmp/Cpanel_*;
rm -fv /home/*/logs/*;
rm -fv /home/*/cache/*;
rm -r -fv /home/*/directadmin_backups;
# Error Log sil
cd /home;
find -name "error_log" -exec rm -rf {} \;
################################################
# Genel Kodlar
/scripts/upcp ;
/scripts/updatenow ;
/scripts/sysup ;
/scripts/fixeverything ;
/scripts/exim4 ;
/scripts/easyapache ;
/scripts/securetmp ;
# Toplu cpanel yedeklerini silme
for user in `/bin/ls -A /var/cpanel/users` ; do rm -fv /home/$user/backup-*$user.tar.gz ; done
#Sunucudaki disk kullanımı bilgisi
df -h
#Eski olan mailleri sil
savedbefore 26weeks
for user in `/bin/ls -A /var/cpanel/users` ; do /usr/bin/archivemail --quiet --delete --days 365 /home/$user/mail/* ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment