<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EZ Linux Admin</title>
	<atom:link href="http://www.ezlinuxadmin.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ezlinuxadmin.com</link>
	<description>Making Linux Easier</description>
	<lastBuildDate>Tue, 15 May 2012 04:57:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How do I restart Linux network service?</title>
		<link>http://www.ezlinuxadmin.com/2012/05/how-do-i-restart-linux-network-service/</link>
		<comments>http://www.ezlinuxadmin.com/2012/05/how-do-i-restart-linux-network-service/#comments</comments>
		<pubDate>Mon, 14 May 2012 22:09:02 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[Linux Software / Scripts]]></category>
		<category><![CDATA[Linux Tricks]]></category>
		<category><![CDATA[network service]]></category>
		<category><![CDATA[restart Linux]]></category>
		<category><![CDATA[restart network service]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=582</guid>
		<description><![CDATA[RedHat Linux command to reload or restart network (login as root user): # service network restart OR # /etc/init.d/network restart To start Linux network service: # service network start To stop Linux network service: # service network stop Debian Linux command to reload or restart network: # /etc/init.d/networking restart To start Linux network service: # [...]]]></description>
			<content:encoded><![CDATA[<p><strong>RedHat Linux</strong> command to reload or restart network (login as root user):</p>
<p><code># service network restart</code><br />
OR<br />
<code># /etc/init.d/network restart</code></p>
<p>To start Linux network service:<br />
<code># service network start</code></p>
<p>To stop Linux network service:<br />
<code># service network stop</code></p>
<p><strong>Debian Linux</strong> command to reload or restart network:<br />
<code> # /etc/init.d/networking restart</code></p>
<p>To start Linux network service:<br />
<code> # /etc/init.d/networking start</code></p>
<p>To stop Linux network service:<br />
<code> # /etc/init.d/networking stop</code></p>
<p>Ubuntu Linux user use sudo command with above Debian Linux command:<br />
<code> # sudo /etc/init.d/networking restart</code></p>
<p>To start Linux network service:<br />
<code> # sudo /etc/init.d/networking start</code></p>
<p>To stop Linux network service:<br />
<code> # sudo /etc/init.d/networking stop</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2012/05/how-do-i-restart-linux-network-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VI basic basics</title>
		<link>http://www.ezlinuxadmin.com/2012/05/vi-basic-basics/</link>
		<comments>http://www.ezlinuxadmin.com/2012/05/vi-basic-basics/#comments</comments>
		<pubDate>Mon, 14 May 2012 21:12:41 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[Linux Commands]]></category>
		<category><![CDATA[Linux Software / Scripts]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[cheat sheet]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vi basics]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=576</guid>
		<description><![CDATA[Starting: vi filename          edit filename starting at line 1 vi -r filename     recover filename that was being edited when system crashed Exiting: :x&#60;Return&#62;     quit vi, writing out modified file to file named in original invocation :wq&#60;Return&#62;     quit vi, writing out modified file to file named in original invocation :q&#60;Return&#62;    [...]]]></description>
			<content:encoded><![CDATA[<p>Starting:</p>
<p><code>vi filename          edit filename starting at line 1<br />
vi -r filename     recover filename that was being edited when system crashed</code></p>
<p>Exiting:</p>
<p><code>:x&lt;Return&gt;     quit vi, writing out modified file to file named in original invocation<br />
:wq&lt;Return&gt;     quit vi, writing out modified file to file named in original invocation<br />
:q&lt;Return&gt;     quit (or exit) vi<br />
:q!&lt;Return&gt;     quit vi even though latest changes have not been saved for this vi call</code></p>
<p>To edit a file just &#8220;esc&#8221; to make sure your at the command prompt then hold &#8220;Control and the letter I&#8221; This is the normal edit mode.</p>
<p>When your done click &#8220;esc&#8221; again and then type &#8220;:w&#8221; to save the file.</p>
<p>Then type &#8220;:q&#8221; to exit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2012/05/vi-basic-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install CPanel over Centos 6 minimal</title>
		<link>http://www.ezlinuxadmin.com/2012/05/how-to-install-cpanel-over-centos-6-minimal/</link>
		<comments>http://www.ezlinuxadmin.com/2012/05/how-to-install-cpanel-over-centos-6-minimal/#comments</comments>
		<pubDate>Mon, 14 May 2012 00:20:37 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cpanel and WHM]]></category>
		<category><![CDATA[Installing Linux]]></category>
		<category><![CDATA[Linux Commands]]></category>
		<category><![CDATA[Linux Operating Systems]]></category>
		<category><![CDATA[Linux Software / Scripts]]></category>
		<category><![CDATA[Linux Tricks]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[minimal]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=573</guid>
		<description><![CDATA[To install CPanel over Centos minimal 6 you need to get some basic packages. You can easily grab those with YUM here is the package command to get Centos Minimal install ready for CPanel. yum groupinstall base]]></description>
			<content:encoded><![CDATA[<p>To install CPanel over Centos minimal 6 you need to get some basic packages. You can easily grab those with YUM here is the package command to get Centos Minimal install ready for CPanel.</p>
<p><code>yum groupinstall base</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2012/05/how-to-install-cpanel-over-centos-6-minimal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Tell What Type of Memory Your Linux PC Has Installed</title>
		<link>http://www.ezlinuxadmin.com/2012/05/linux-type-memory-ram/</link>
		<comments>http://www.ezlinuxadmin.com/2012/05/linux-type-memory-ram/#comments</comments>
		<pubDate>Sun, 06 May 2012 19:49:05 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[Cpanel and WHM]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux Tricks]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[type]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=569</guid>
		<description><![CDATA[Here it is, the magic code. Just run this as root and it will give you the ddr, mhz, and much more. sudo dmidecode --type memory]]></description>
			<content:encoded><![CDATA[<p>Here it is, the magic code. Just run this as root and it will give you the ddr, mhz, and much more.</p>
<p><code>sudo dmidecode --type memory</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2012/05/linux-type-memory-ram/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to increase upload limit for PhpMyAdmin on a Cpanel server</title>
		<link>http://www.ezlinuxadmin.com/2012/04/how-to-increase-upload-limit-for-phpmyadmin-on-a-cpanel-server/</link>
		<comments>http://www.ezlinuxadmin.com/2012/04/how-to-increase-upload-limit-for-phpmyadmin-on-a-cpanel-server/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 07:51:45 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cpanel and WHM]]></category>
		<category><![CDATA[Linux Software / Scripts]]></category>
		<category><![CDATA[Linux Tricks]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[limit]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[raise]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=566</guid>
		<description><![CDATA[By default, PhpMyAdmin in a Cpanel server imposes an upload limit of 50MB. So importing a SQL file larger than 50MB may time out. Cpanel PhpMyAdmin uses the php.ini file /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini. To increase upload limit, change values of upload_max_filesize and post_max_size in this php.ini file. Typically, you may set value of post_max_size to twice the [...]]]></description>
			<content:encoded><![CDATA[<p>By default, PhpMyAdmin in a Cpanel server imposes an upload limit of 50MB. So importing a SQL file larger than 50MB may time out.</p>
<p>Cpanel PhpMyAdmin uses the php.ini file /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini. To increase upload limit, change values of upload_max_filesize and post_max_size in this php.ini file. Typically, you may set value of post_max_size to twice the value of upload_max_filesize. For example, to import SQL files up to 250MB size, set upload_max_filesize to 250MB and post_max_size to 500MB. You may also want to change values of max_execution_time and memory_limit.</p>
<p>Typical values may be:</p>
<p>upload_max_filesize = 250MB<br />
post_max_size = 500MB<br />
memory_limit = 512MB<br />
max_execution_time = 3600</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2012/04/how-to-increase-upload-limit-for-phpmyadmin-on-a-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting CentOS 5.x or 6.x to CloudLinux (with cPanel &amp; WHM installed)</title>
		<link>http://www.ezlinuxadmin.com/2012/02/converting-centos-5-x-or-6-x-to-cloudlinux-with-cpanel-whm-installed/</link>
		<comments>http://www.ezlinuxadmin.com/2012/02/converting-centos-5-x-or-6-x-to-cloudlinux-with-cpanel-whm-installed/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 06:05:07 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cpanel and WHM]]></category>
		<category><![CDATA[Linux Security]]></category>
		<category><![CDATA[Linux Software / Scripts]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[cloudlinux]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=564</guid>
		<description><![CDATA[Converting CentOS 5.x or 6.x to CloudLinux (with cPanel &#038; WHM installed) If you wish to convert from CentOS 5.x or 6.x to CloudLinux, have already installed cPanel &#038; WHM, and own an IP-based CloudLinux license, run these commands: /usr/local/cpanel/cpkeyclt /usr/local/cpanel/bin/cloudlinux_system_install -k reboot /usr/local/cpanel/scripts/easyapache &#8211;build If you wish to convert from CentOS 5.x or 6.x [...]]]></description>
			<content:encoded><![CDATA[<p>Converting CentOS 5.x or 6.x to CloudLinux (with cPanel &#038; WHM installed)</p>
<p>If you wish to convert from CentOS 5.x or 6.x to CloudLinux, have already installed cPanel &#038; WHM, and own an IP-based CloudLinux license, run these commands:</p>
<p>    /usr/local/cpanel/cpkeyclt<br />
    /usr/local/cpanel/bin/cloudlinux_system_install -k<br />
    reboot<br />
    /usr/local/cpanel/scripts/easyapache &#8211;build </p>
<p>If you wish to convert from CentOS 5.x or 6.x to CloudLinux, have already installed cPanel &#038; WHM, and own a CloudLinux license key, run these commands:</p>
<p>    wget http://repo.cloudlinux.com/cloudlinux/sources/cln/cpanel2cl<br />
    sh cpanel2cl -k $key<br />
        Replace $key with your license key.<br />
    reboot<br />
    /scripts/easyapache &#8211;build </p>
<p>Starting Cloud Linux:</p>
<p># lvectl ubc enable &#8211;save</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2012/02/converting-centos-5-x-or-6-x-to-cloudlinux-with-cpanel-whm-installed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>kill a linux process that won’t die</title>
		<link>http://www.ezlinuxadmin.com/2012/02/kill-a-linux-process-that-wont-die/</link>
		<comments>http://www.ezlinuxadmin.com/2012/02/kill-a-linux-process-that-wont-die/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 18:43:39 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Linux Commands]]></category>
		<category><![CDATA[Linux Operating Systems]]></category>
		<category><![CDATA[Linux Security]]></category>
		<category><![CDATA[Linux Software / Scripts]]></category>
		<category><![CDATA[Linux Tricks]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=561</guid>
		<description><![CDATA[kill -s 9 [PID] Also try it without the -s if it won&#8217;t go.]]></description>
			<content:encoded><![CDATA[<p>kill -s 9 [PID]</p>
<p>Also try it without the -s if it won&#8217;t go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2012/02/kill-a-linux-process-that-wont-die/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to search a directory for a certain search string.</title>
		<link>http://www.ezlinuxadmin.com/2012/01/how-to-search-a-directory-for-a-certain-search-string/</link>
		<comments>http://www.ezlinuxadmin.com/2012/01/how-to-search-a-directory-for-a-certain-search-string/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 09:48:09 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Linux Commands]]></category>
		<category><![CDATA[Linux Software / Scripts]]></category>
		<category><![CDATA[Linux Tricks]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=558</guid>
		<description><![CDATA[Pretty simple, this takes minimal load and delivers the data as it&#8217;s found. grep -R String *]]></description>
			<content:encoded><![CDATA[<p>Pretty simple, this takes minimal load and delivers the data as it&#8217;s found.</p>
<p><code>grep -R String *</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2012/01/how-to-search-a-directory-for-a-certain-search-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>add a 404 page to each website on a cpanel server</title>
		<link>http://www.ezlinuxadmin.com/2011/12/404-page-website-cpanel-server/</link>
		<comments>http://www.ezlinuxadmin.com/2011/12/404-page-website-cpanel-server/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 07:58:59 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cpanel and WHM]]></category>
		<category><![CDATA[Linux Security]]></category>
		<category><![CDATA[Linux Software / Scripts]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=555</guid>
		<description><![CDATA[#!/usr/bin/perl # cPlicensing.net &#8211; scripts            Copyright(c) 2003 cPlicensing.net. #                                     All rights Reserved. # support@cPlicensing.net              http://cPlicensing.net # Version: 0.02 print &#8220;Starting Scan&#8230;\n&#8221;; while(@USERS=getpwent()){ if (-d &#8220;$USERS[7]/public_html&#8221;) { if (-f &#8220;$USERS[7]/public_html/404.shtml&#8221;) { print &#8220;$USERS[0] 404.shtml exists\n&#8221;; } else { print &#8220;$USERS[0] creating 404.shtml&#8230;&#8221;; open(FILE,&#8221;&#62;$USERS[7]/public_html/404.shtml&#8221;) or die &#8220;Unable to create file: $!&#8221;; close(FILE); chmod(0644, [...]]]></description>
			<content:encoded><![CDATA[<p>#!/usr/bin/perl<br />
# cPlicensing.net &#8211; scripts            Copyright(c) 2003 cPlicensing.net.<br />
#                                     All rights Reserved.<br />
# support@cPlicensing.net              http://cPlicensing.net<br />
# Version: 0.02</p>
<p>print &#8220;Starting Scan&#8230;\n&#8221;;</p>
<p>while(@USERS=getpwent()){<br />
if (-d &#8220;$USERS[7]/public_html&#8221;) {<br />
if (-f &#8220;$USERS[7]/public_html/404.shtml&#8221;) {<br />
print &#8220;$USERS[0] 404.shtml exists\n&#8221;;<br />
} else {<br />
print &#8220;$USERS[0] creating 404.shtml&#8230;&#8221;;<br />
open(FILE,&#8221;&gt;$USERS[7]/public_html/404.shtml&#8221;) or die &#8220;Unable to create file: $!&#8221;;<br />
close(FILE);<br />
chmod(0644, &#8220;$USERS[7]/public_html/404.shtml&#8221;) or die &#8220;Unable to chmod file: $!&#8221;;<br />
chown($USERS[2],$USERS[3],&#8221;$USERS[7]/public_html/404.shtml&#8221;) or die &#8220;Unable to chown file: $!&#8221;;<br />
print &#8220;done\n&#8221;;<br />
}<br />
}<br />
}<br />
if (-f &#8220;/root/cpanel3-skel/public_html/404.shtml&#8221;) {<br />
print &#8220;404.shtml file exists in skel dir\n&#8221;;<br />
} else {<br />
print &#8220;Creating 404.shtml file in skel dir&#8230;&#8221;;<br />
open(FILE,&#8221;&gt;/root/cpanel3-skel/public_html/404.shtml&#8221;) or die &#8220;Unable to create file: $!&#8221;;<br />
print &#8220;done\n&#8221;;<br />
}</p>
<p>print &#8220;Scan Complete!\n&#8221;;</p>
<p>#ChangeLog<br />
#Version :: YYYY.MM.DD :: Type :: Description<br />
#<br />
#0.2 :: 2003.11.06 :: Bug Fix :: 404.shtml was created in the root skel folder, changed to public_html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2011/12/404-page-website-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup cleaner script for cpanel</title>
		<link>http://www.ezlinuxadmin.com/2011/12/backup-cleaner-script-for-cpanel/</link>
		<comments>http://www.ezlinuxadmin.com/2011/12/backup-cleaner-script-for-cpanel/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 07:53:50 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cpanel and WHM]]></category>
		<category><![CDATA[Linux Security]]></category>
		<category><![CDATA[Linux Software / Scripts]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[cleaner]]></category>

		<guid isPermaLink="false">http://www.ezlinuxadmin.com/?p=551</guid>
		<description><![CDATA[#!/usr/bin/perl # cPlicensing.net &#8211; scripts             Copyright(c) 2003 cPlicensing.net. #                                       All rights Reserved. # support@cPlicensing.net               http://cPlicensing.net # Unauthorized copying is prohibited #Version: 0.01 use POSIX; $delete_old     = &#8217;1&#8242;; #0 or 1, set to 1 to remove old account backups if($ARGV[0] eq &#8220;-d&#8221;) { $delete_old = &#8217;1&#8242;; } $&#124;++; POSIX::nice(19); print &#8220;Reading Backup Config&#8230;&#8221;; open(CPBACK,&#8221;/etc/cpbackup.conf&#8221;) or [...]]]></description>
			<content:encoded><![CDATA[<p>#!/usr/bin/perl<br />
# cPlicensing.net &#8211; scripts             Copyright(c) 2003 cPlicensing.net.<br />
#                                       All rights Reserved.<br />
# support@cPlicensing.net               http://cPlicensing.net<br />
# Unauthorized copying is prohibited<br />
#Version: 0.01</p>
<p>use POSIX;</p>
<p>$delete_old     = &#8217;1&#8242;; #0 or 1, set to 1 to remove old account backups<br />
if($ARGV[0] eq &#8220;-d&#8221;) { $delete_old = &#8217;1&#8242;; }</p>
<p>$|++;<br />
POSIX::nice(19);</p>
<p>print &#8220;Reading Backup Config&#8230;&#8221;;<br />
open(CPBACK,&#8221;/etc/cpbackup.conf&#8221;) or die(&#8220;Failed, Does it exist and do you have access?\n&#8221;);<br />
while(&lt;CPBACK&gt;) {<br />
s/\n//g;<br />
my($name,$value) = split(/ /, $_);<br />
$CONF{$name} = $value;<br />
}<br />
close(CPBACK);<br />
print &#8220;Complete\n&#8221;;</p>
<p>if ($CONF{&#8216;BACKUPENABLE&#8217;} ne &#8220;yes&#8221;) {<br />
die &#8220;Backup Not Enabled\n&#8221;;<br />
}<br />
if (! -e $CONF{&#8216;BACKUPDIR&#8217;}){<br />
die &#8220;Backup Dir Doesnt Exist\n&#8221;;<br />
}</p>
<p>until (`ps ax` !~ m/cpbackup/) {<br />
print &#8220;Detected cpbackup process&#8230;Sleeping for 60 Seconds\n&#8221;;<br />
sleep(60);<br />
};</p>
<p>if ($CONF{&#8216;BACKUPMOUNT&#8217;} eq &#8220;yes&#8221;) {<br />
if(`mount` !~ m/$CONF{&#8216;BACKUPDIR&#8217;}/){<br />
system(&#8220;mount&#8221;,&#8221;$CONF{&#8216;BACKUPDIR&#8217;}&#8221;);<br />
}<br />
system(&#8220;mount&#8221;,&#8221;-o&#8221;,&#8221;remount,rw&#8221;,&#8221;$CONF{&#8216;BACKUPDIR&#8217;}&#8221;);<br />
}</p>
<p>cleandir(&#8220;$CONF{&#8216;BACKUPDIR&#8217;}/cpbackup/daily&#8221;);<br />
cleandir(&#8220;$CONF{&#8216;BACKUPDIR&#8217;}/cpbackup/weekly&#8221;);<br />
cleandir(&#8220;$CONF{&#8216;BACKUPDIR&#8217;}/cpbackup/monthly&#8221;);</p>
<p>if ($CONF{&#8216;BACKUPMOUNT&#8217;} eq &#8220;yes&#8221;) { system(&#8220;umount&#8221;,&#8221;$CONF{&#8216;BACKUPDIR&#8217;}&#8221;); }</p>
<p>sub cleandir {<br />
my($target) = @_;</p>
<p>opendir(DIRTYDIR,&#8221;$target&#8221;);<br />
@DIRTYDIR = readdir(DIRTYDIR);<br />
closedir(DIRTYDIR);</p>
<p>foreach(@DIRTYDIR) {<br />
next if /^\.\.?$|^files$|^dirs$/;<br />
if(-f &#8220;$target/$_&#8221;){<br />
$user = $_;<br />
$user =~ s/.tar.gz//;<br />
if(! -f &#8220;/var/cpanel/users/$user&#8221;){<br />
if($delete_old == 1){<br />
unlink(&#8220;$target/$_&#8221;);<br />
print &#8220;Deleted Old Backup&#8230; $target/$_\n&#8221;;<br />
} else {<br />
print &#8220;Detected Old Backup&#8230; $target/$_\n&#8221;;<br />
}<br />
}<br />
next;<br />
}<br />
if(-d &#8220;$target/$_&#8221;){<br />
if(! -f &#8220;/var/cpanel/users/$_&#8221;){<br />
if($delete_old == 1){<br />
system(&#8220;rm&#8221;,&#8221;-r&#8221;,&#8221;$target/$_&#8221;);<br />
#print &#8220;Directory Delete Not Supported, If you really want to remove dirs (incremental backups) you can edit this script and uncomment the line that looks like #system(\&#8221;rm\&#8221;,\&#8221;-r\&#8221;,\&#8221;$target/$_\&#8221;)\n&#8221;;<br />
} else {<br />
print &#8220;Detected Old Backup&#8230; $target/$_\n&#8221;;<br />
}<br />
}<br />
next;<br />
}<br />
}<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2011/12/backup-cleaner-script-for-cpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

