{"id":2006,"date":"2024-09-30T10:42:54","date_gmt":"2024-09-30T07:42:54","guid":{"rendered":"https:\/\/saviorhost.com\/?p=2006"},"modified":"2025-09-04T21:19:47","modified_gmt":"2025-09-04T18:19:47","slug":"cwpde-log-dosyalarini-temizleme-ve-disk-alani-optimizasyonu-adim-adim-rehber","status":"publish","type":"post","link":"https:\/\/saviorhost.com\/blog\/cwpde-log-dosyalarini-temizleme-ve-disk-alani-optimizasyonu-adim-adim-rehber\/","title":{"rendered":"CWP&#8217;de Log Dosyalar\u0131n\u0131 Temizleme ve Disk Alan\u0131 Optimizasyonu: Ad\u0131m Ad\u0131m Rehber"},"content":{"rendered":"<p>CWP (Control Web Panel) \u00fczerinde disk alan\u0131 bo\u015faltmak ve log dosyalar\u0131n\u0131 temizlemek, sunucunuzun performans\u0131n\u0131 art\u0131rabilir. A\u015fa\u011f\u0131da, log dosyalar\u0131n\u0131 temizleme ve disk alan\u0131n\u0131 optimize etme ad\u0131mlar\u0131 \u00f6zg\u00fcn bir \u015fekilde anlat\u0131lmaktad\u0131r:<\/p>\n<h3 id=\"1-cwpnin-log-temizleme-scriptini-kullanma\">1. CWP&#8217;nin Log Temizleme Scriptini Kullanma<\/h3>\n<p>CWP, kendi dahili temizleme scriptine sahiptir. Bu script, log dosyalar\u0131n\u0131 h\u0131zl\u0131ca temizlemek i\u00e7in kullan\u0131labilir. SSH \u00fczerinden root olarak giri\u015f yap\u0131n ve \u015fu komutu \u00e7al\u0131\u015ft\u0131r\u0131n:<\/p>\n<div class=\"dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative\">\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-main-surface-secondary px-2 font-sans text-xs text-token-text-secondary\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">sh \/usr\/local\/cwpsrv\/htdocs\/resources\/scripts\/clean_all<br \/>\n<\/code><\/div>\n<\/div>\n<p>Bu komut, gereksiz log dosyalar\u0131n\u0131 temizleyecek ve disk alan\u0131 a\u00e7acakt\u0131r.<\/p>\n<h3 id=\"2-bash-script-ile-hizli-log-temizleme\">2. Bash Script ile H\u0131zl\u0131 Log Temizleme<\/h3>\n<p>E\u011fer kendi scriptinizi olu\u015fturmak istiyorsan\u0131z, bash kullanarak basit bir script yazabilirsiniz. SSH terminaline ba\u011flanarak \u015fu ad\u0131mlar\u0131 izleyin:<\/p>\n<p>Bir bash script olu\u015fturun:<\/p>\n<div class=\"dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative\">\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-main-surface-secondary px-2 font-sans text-xs text-token-text-secondary\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">nano \/root\/logtemizle.sh<br \/>\n<\/code><\/div>\n<\/div>\n<p>\u0130\u00e7ine a\u015fa\u011f\u0131daki kodlar\u0131 ekleyin:<\/p>\n<div class=\"dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative\">\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-main-surface-secondary px-2 font-sans text-xs text-token-text-secondary\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\"><span class=\"hljs-meta\">#!\/bin\/bash<\/span><br \/>\n<span class=\"hljs-built_in\">rm<\/span> -f \/var\/log\/*.<span class=\"hljs-built_in\">log<\/span><br \/>\n<span class=\"hljs-built_in\">rm<\/span> -f \/usr\/local\/cwpsrv\/logs\/*.<span class=\"hljs-built_in\">log<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<p>Scripti \u00e7al\u0131\u015ft\u0131r\u0131labilir hale getirin:<\/p>\n<div class=\"dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative\">\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-main-surface-secondary px-2 font-sans text-xs text-token-text-secondary\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\"><span class=\"hljs-built_in\">chmod<\/span> +x \/root\/logtemizle.sh<br \/>\n<\/code><\/div>\n<\/div>\n<p>Scripti \u00e7al\u0131\u015ft\u0131rmak i\u00e7in:<\/p>\n<div class=\"dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative\">\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-main-surface-secondary px-2 font-sans text-xs text-token-text-secondary\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">sh \/root\/logtemizle.sh<br \/>\n<\/code><\/div>\n<\/div>\n<h3 id=\"3-cron-job-ile-otomatik-temizleme\">3. Cron Job ile Otomatik Temizleme<\/h3>\n<p>Disk alan\u0131n\u0131 d\u00fczenli olarak temizlemek i\u00e7in cron job olu\u015fturabilirsiniz. B\u00f6ylece belirledi\u011finiz periyotlarda loglar otomatik olarak temizlenir. SSH terminalinde cron job eklemek i\u00e7in:<\/p>\n<div class=\"dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative\">\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-main-surface-secondary px-2 font-sans text-xs text-token-text-secondary\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">crontab -e<br \/>\n<\/code><\/div>\n<\/div>\n<p>\u015eu sat\u0131r\u0131 ekleyin (her gece 3:00&#8217;te log temizleme i\u00e7in):<\/p>\n<div class=\"dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative\">\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-main-surface-secondary px-2 font-sans text-xs text-token-text-secondary\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">0 3 * * * \/root\/logtemizle.sh<br \/>\n<\/code><\/div>\n<\/div>\n<p>Bu y\u00f6ntemlerle disk alan\u0131n\u0131z\u0131 optimize edebilir, log dosyalar\u0131n\u0131 temizleyerek sunucu performans\u0131n\u0131 art\u0131rabilirsiniz.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CWP (Control Web Panel) \u00fczerinde disk alan\u0131 bo\u015faltmak ve log dosyalar\u0131n\u0131 temizlemek, sunucunuzun performans\u0131n\u0131 art\u0131rabilir. A\u015fa\u011f\u0131da, log dosyalar\u0131n\u0131 temizleme ve&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2095,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60,62],"tags":[],"class_list":["post-2006","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos-web-panel","category-guvenlik"],"_links":{"self":[{"href":"https:\/\/saviorhost.com\/blog\/wp-json\/wp\/v2\/posts\/2006","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/saviorhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/saviorhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/saviorhost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/saviorhost.com\/blog\/wp-json\/wp\/v2\/comments?post=2006"}],"version-history":[{"count":2,"href":"https:\/\/saviorhost.com\/blog\/wp-json\/wp\/v2\/posts\/2006\/revisions"}],"predecessor-version":[{"id":2009,"href":"https:\/\/saviorhost.com\/blog\/wp-json\/wp\/v2\/posts\/2006\/revisions\/2009"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/saviorhost.com\/blog\/wp-json\/wp\/v2\/media\/2095"}],"wp:attachment":[{"href":"https:\/\/saviorhost.com\/blog\/wp-json\/wp\/v2\/media?parent=2006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/saviorhost.com\/blog\/wp-json\/wp\/v2\/categories?post=2006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/saviorhost.com\/blog\/wp-json\/wp\/v2\/tags?post=2006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}