<?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>Eddie On Everything &#187; linux</title>
	<atom:link href="http://www.eddieoneverything.com/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.eddieoneverything.com</link>
	<description>Tips &#38; tricks on things that interest me</description>
	<lastBuildDate>Wed, 11 Jan 2012 08:29:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Caution: filename not matched error when unzipping multiple files workaround</title>
		<link>http://www.eddieoneverything.com/linux/caution-filename-not-matched-error-when-unzipping-multiple-files-workaround.php</link>
		<comments>http://www.eddieoneverything.com/linux/caution-filename-not-matched-error-when-unzipping-multiple-files-workaround.php#comments</comments>
		<pubDate>Fri, 22 Apr 2011 16:43:26 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[unzip]]></category>

		<guid isPermaLink="false">http://www.eddieoneverything.com/linux/caution-filename-not-matched-error-when-unzipping-multiple-files-workaround.php</guid>
		<description><![CDATA[I was unzipping a boatload of zip files today, and I casually entered “unzip *zip” into my Linux command line.
No way, said my system.
Instead of unzipping the files, I got a bunch of warnings that read: “caution: filename not matched,” followed by a filename.&#160; At the end of the listing, unzip told me “1 archive [...]]]></description>
			<content:encoded><![CDATA[<p>I was unzipping a boatload of zip files today, and I casually entered “unzip *zip” into my Linux command line.</p>
<p>No way, said my system.</p>
<p>Instead of unzipping the files, I got a bunch of warnings that read: “caution: filename not matched,” followed by a filename.&#160; At the end of the listing, unzip told me “1 archive had fatal errors.”&#160; (And that’s the clue… 1 archive.)</p>
<p>To understand what’s happening here, you have to understand what happens when you use a wildcard in a Unix shell.&#160; When you type “unzip *zip,” your shell (bash, bourne, korn, whatever) doesn’t actually pass that “*” to the program you’re calling – instead, it performs the wildcard match against the specified files, then passes the list of files to the program.&#160; </p>
<p>So when you type “unzip *” in a directory containing files A, B, C, and D, your shell actually calls the unzip program with 4 arguments – A, B, C, and D.&#160; A quick check of the unzip man page shows that unzip accepts only one archive name, and treats subsequent file names as files you want to extract from that archive.&#160; In other words, when you type “unzip *”, you’re really saying “unzip A B C D”, which unzip translates into “Oh, you want me to pull files B, C, and D out of archive A.”</p>
<p>To work around this problem, you need only escape the wildcard operator to prevent the shell from translating it.&#160; </p>
<p>So instead of “unzip *zip” type “unzip \*zip”.</p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://www.eddieoneverything.com/articles/linux-forward-file-not-working-make-sure-you-have-the-permissions-set-correctly.php" title="Linux .forward file not working?  Make sure you have the permissions set correctly">Linux .forward file not working?  Make sure you have the permissions set correctly</a></li><li><a href="http://www.eddieoneverything.com/articles/the-zen-of-taco-bell-programming-using-unix-tools-to-prevent-reinventing-the-wheel.php" title="The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel">The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel</a></li><li><a href="http://www.eddieoneverything.com/linux/how-to-keep-an-ssh-connection-alive-in-linux.php" title="How To Keep An SSH Connection Alive in Linux">How To Keep An SSH Connection Alive in Linux</a></li><li><a href="http://www.eddieoneverything.com/articles/managing-server-load-when-unzipping-many-large-files.php" title="Managing Server Load when unzipping many large files">Managing Server Load when unzipping many large files</a></li><li><a href="http://www.eddieoneverything.com/articles/how-to-scan-a-computer-for-open-ports.php" title="How to Scan a Computer for Open Ports">How to Scan a Computer for Open Ports</a></li><li><a href="http://www.eddieoneverything.com/linux/rotating-backup-directories-using-cp-al-hardlinks-to-save-disk-space.php" title="Rotating Backup Directories using cp -al (hardlinks) to Save Disk Space">Rotating Backup Directories using cp -al (hardlinks) to Save Disk Space</a></li><li><a href="http://www.eddieoneverything.com/linux/argument-list-too-long-from-rm-command-a-perl-script-to-get-around-the-problem.php" title="&#8220;Argument list too long&#8221; from rm command.   A Perl Script to Get Around the Problem">&#8220;Argument list too long&#8221; from rm command.   A Perl Script to Get Around the Problem</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.eddieoneverything.com/linux/caution-filename-not-matched-error-when-unzipping-multiple-files-workaround.php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Keep An SSH Connection Alive in Linux</title>
		<link>http://www.eddieoneverything.com/linux/how-to-keep-an-ssh-connection-alive-in-linux.php</link>
		<comments>http://www.eddieoneverything.com/linux/how-to-keep-an-ssh-connection-alive-in-linux.php#comments</comments>
		<pubDate>Tue, 16 Mar 2010 13:43:12 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ssh configuration]]></category>
		<category><![CDATA[ssh timeout]]></category>
		<category><![CDATA[sshd]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.eddieoneverything.com/?p=1083</guid>
		<description><![CDATA[By default, many Linux configurations automatically close SSH sessions after a certain amount of inactivity.
You can easily change this setting on your system by editing the sshd configuration file.
Of course, before doing so, you should consider the security implications of keeping SSH sessions active. Setting your server to keep connections alive may present a security [...]]]></description>
			<content:encoded><![CDATA[<p>By default, many Linux configurations automatically close SSH sessions after a certain amount of inactivity.</p>
<p>You can easily change this setting on your system by editing the sshd configuration file.</p>
<p>Of course, before doing so, you should consider the security implications of keeping SSH sessions active. Setting your server to keep connections alive may present a security risk, as users may inadvertently leave connections active &#038; walk away from their computer.  Worse, they may purposely leave them active, not realizing the security risk.</p>
<p>Since I do all of my computing from steel-reinforced steel bunker buried deep in the ground and secured by armed guards 24&#215;7, I&#8217;m not worried about the security implications of leaving sessions active.</p>
<p>To set your Ubuntu, Red Hat, or CentOS server to keep ssh connections alive, you need to edit the /etc/ssh/sshd_config file and edit the TCPKeepAlive and ClientAliveInterval lines.  Uncomment these lines if commented out, and make the following changes:</p>
<p><code><br />
vi /etc/ssh/sshd_config </p>
<p>TCPKeepAlive yes<br />
ClientAliveInterval 300<br />
</code></p>
<p>After doing so, restart the sshd daemon.<br />
<code><br />
/etc/init.d/sshd restart<br />
</code></p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://www.eddieoneverything.com/articles/the-zen-of-taco-bell-programming-using-unix-tools-to-prevent-reinventing-the-wheel.php" title="The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel">The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel</a></li><li><a href="http://www.eddieoneverything.com/articles/linux-forward-file-not-working-make-sure-you-have-the-permissions-set-correctly.php" title="Linux .forward file not working?  Make sure you have the permissions set correctly">Linux .forward file not working?  Make sure you have the permissions set correctly</a></li><li><a href="http://www.eddieoneverything.com/linux/caution-filename-not-matched-error-when-unzipping-multiple-files-workaround.php" title="Caution: filename not matched error when unzipping multiple files workaround">Caution: filename not matched error when unzipping multiple files workaround</a></li><li><a href="http://www.eddieoneverything.com/articles/managing-server-load-when-unzipping-many-large-files.php" title="Managing Server Load when unzipping many large files">Managing Server Load when unzipping many large files</a></li><li><a href="http://www.eddieoneverything.com/articles/how-to-scan-a-computer-for-open-ports.php" title="How to Scan a Computer for Open Ports">How to Scan a Computer for Open Ports</a></li><li><a href="http://www.eddieoneverything.com/linux/rotating-backup-directories-using-cp-al-hardlinks-to-save-disk-space.php" title="Rotating Backup Directories using cp -al (hardlinks) to Save Disk Space">Rotating Backup Directories using cp -al (hardlinks) to Save Disk Space</a></li><li><a href="http://www.eddieoneverything.com/linux/argument-list-too-long-from-rm-command-a-perl-script-to-get-around-the-problem.php" title="&#8220;Argument list too long&#8221; from rm command.   A Perl Script to Get Around the Problem">&#8220;Argument list too long&#8221; from rm command.   A Perl Script to Get Around the Problem</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.eddieoneverything.com/linux/how-to-keep-an-ssh-connection-alive-in-linux.php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rotating Backup Directories using cp -al (hardlinks) to Save Disk Space</title>
		<link>http://www.eddieoneverything.com/linux/rotating-backup-directories-using-cp-al-hardlinks-to-save-disk-space.php</link>
		<comments>http://www.eddieoneverything.com/linux/rotating-backup-directories-using-cp-al-hardlinks-to-save-disk-space.php#comments</comments>
		<pubDate>Sun, 15 Nov 2009 20:13:16 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[system administration]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.eddieoneverything.com/?p=356</guid>
		<description><![CDATA[The copy command &#8220;cp -al&#8221; found on all versions of Unix/Linux creates what&#8217;s called a &#8220;hard link&#8221; to a file. The nice thing about this command is that it doesn&#8217;t create an actual copy of the file on disk &#8211; instead, it creates a &#8220;link&#8221; or pointer to the file data on the disk.  [...]]]></description>
			<content:encoded><![CDATA[<p>The copy command &#8220;cp -al&#8221; found on all versions of Unix/Linux creates what&#8217;s called a &#8220;hard link&#8221; to a file. The nice thing about this command is that it doesn&#8217;t create an actual copy of the file on disk &#8211; instead, it creates a &#8220;link&#8221; or pointer to the file data on the disk.  Basically a &#8220;snapshot&#8221; of that directory in-time.   The net result is that you can have 10 &#8220;copies&#8217; of a 10G file that only take up a total of 10G. </p>
<p>This nifty behavior makes cp -al, when combined with rsync,  ideal for backup systems.  One can use the cp -al command to take a &#8220;snapshot&#8221; of a given directory tree at a given time, at the expense of very little additional disk space.  I use this script in concert with my <a href="http://www.eddieoneverything.com/linux/using-rsync-ssh-to-backup-files-between-linux-machines-perl.php">rsync_backup.pl</a> script to keep 21 days of &#8220;snapshot&#8221; backups of each of my machines.</p>
<pre name="code" class="perl">

#!/usr/bin/perl
use POSIX;

# Rotates backup directories w/ cp -al (hardlinks)
# Deletes directories older than $KEEP_DAYS
# Runs each night ahead of backup process
# (c) 2009 eddie@eddieoneverything.com

$KEEP_DAYS=21;
$LOGFILE = "/var/log/rotate_backups";

@BACKUP_DIRS=(
   '/mnt/backup/hansel',
   '/mnt/backup/tiger',
   '/mnt/backup/june'
);

$ts = get_timestamp();

open hLOG, ">>$LOGFILE";
print hLOG "=" x 80, "\n";
print hLOG "Run START at " . `date` . "\n";
print hLOG "=" x 80, "\n";

## Do the rotation
print hLOG "Do today's rotation\n";
foreach $dir ( @BACKUP_DIRS ){
   print hLOG "\t" , `date`;
   $newfn = $dir ."_" .  $ts;
   $cmd = "cp -al $dir $newfn";
   print hLOG "Execute Command: $cmd\n";
   `$cmd`;
}

## Delete old directories
print hLOG "Delete Old Directories\n";
foreach $dir ( @BACKUP_DIRS ){
   $dir=~m/^(.+)\/(.+?)$/;
   $base= $1;
   $stub=$2;
   #print "dir is $dir\nBASE: $base\nSTUB:$stub\n";

   opendir hDIR, "$base" or die "can't open directory $base";
   @dirlist=grep { /^$stub\_/ &#038;&#038; !/^$stub$/  } readdir(hDIR);
   closedir hDIR;

   foreach $d (@dirlist){
      print hLOG "\t" , `date`;
      $d=~/$stub\_([0-9]+)_([0-9]+)_([0-9]+)_.+$/;
      $year= $1;
      $month = $2;
      $day = $3;

      if (dirIsOlder($year, $month, $day)){
         #print "$d\n";
         $remove_dir= $base . '/' . $d;
         $cmd = "rm -Rf \"$remove_dir\"";
         print hLOG "Execute command: $cmd\n";
         `$cmd`;
      }else{
         print hLOG "Keep $d\n";
      }
   }
}
print hLOG "=" x 80, "\n";
print hLOG "Run END at " . `date` . "\n";
print hLOG "=" x 80, "\n";
close hLOG;

# ------------- Subroutines &#038; functions -----------------

sub get_timestamp {
   ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
   $mon+=1;

   if ($mon < 10) { $mon = "0$mon"; }
   if ($mday < 10) { $mday = "0$mday"; }
   if ($hour < 10) { $hour = "0$hour"; }
   if ($min < 10) { $min = "0$min"; }
   if ($sec < 10) { $sec = "0$sec"; }
   $year=$year+1900;

   return $year . '_' . $mon . '_' . $mday . '__' . $hour . '_' . $min . '_' . $sec;
}

sub dirIsOlder{
   ($fyear, $fmonth, $fday) = @_;
   #print "Check $year - $month - $day \n";

   $now  = mktime(localtime());
   $then =  mktime (0, 0 , 0, $fday-1, $fmonth-1, $fyear-1900 , 0, 0);

   $diff_sec = $now - $then;
   $days_since = $diff_sec / 24 / 60 / 60;
   #print "n: $now. t: $then. Diff ($diff_sec) = $days_since\n";
   #print "$days_since $fyear-$fmonth-$fday\n";

   ## Subtract days from today

   if ($days_since > $KEEP_DAYS){
      return 1;
   }else{
      return 0;
   }
}
</pre>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://www.eddieoneverything.com/linux/using-rsync-ssh-to-backup-files-between-linux-machines-perl.php" title="Using rsync &#038; ssh to Backup Files Between Linux Machines (Perl)">Using rsync &#038; ssh to Backup Files Between Linux Machines (Perl)</a></li><li><a href="http://www.eddieoneverything.com/linux/argument-list-too-long-from-rm-command-a-perl-script-to-get-around-the-problem.php" title="&#8220;Argument list too long&#8221; from rm command.   A Perl Script to Get Around the Problem">&#8220;Argument list too long&#8221; from rm command.   A Perl Script to Get Around the Problem</a></li><li><a href="http://www.eddieoneverything.com/articles/managing-server-load-when-unzipping-many-large-files.php" title="Managing Server Load when unzipping many large files">Managing Server Load when unzipping many large files</a></li><li><a href="http://www.eddieoneverything.com/articles/how-to-scan-a-computer-for-open-ports.php" title="How to Scan a Computer for Open Ports">How to Scan a Computer for Open Ports</a></li><li><a href="http://www.eddieoneverything.com/articles/the-zen-of-taco-bell-programming-using-unix-tools-to-prevent-reinventing-the-wheel.php" title="The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel">The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel</a></li><li><a href="http://www.eddieoneverything.com/articles/linux-forward-file-not-working-make-sure-you-have-the-permissions-set-correctly.php" title="Linux .forward file not working?  Make sure you have the permissions set correctly">Linux .forward file not working?  Make sure you have the permissions set correctly</a></li><li><a href="http://www.eddieoneverything.com/linux/caution-filename-not-matched-error-when-unzipping-multiple-files-workaround.php" title="Caution: filename not matched error when unzipping multiple files workaround">Caution: filename not matched error when unzipping multiple files workaround</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.eddieoneverything.com/linux/rotating-backup-directories-using-cp-al-hardlinks-to-save-disk-space.php/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using rsync &amp; ssh to Backup Files Between Linux Machines (Perl)</title>
		<link>http://www.eddieoneverything.com/linux/using-rsync-ssh-to-backup-files-between-linux-machines-perl.php</link>
		<comments>http://www.eddieoneverything.com/linux/using-rsync-ssh-to-backup-files-between-linux-machines-perl.php#comments</comments>
		<pubDate>Sun, 15 Nov 2009 19:27:32 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[system administration]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.eddieoneverything.com/?p=342</guid>
		<description><![CDATA[This script performs a network backup using unix&#8217;s rsync command over ssh.  It performs an incremental backup, which means that it only updates new files and files that have changed since the last backup, thus minimizing network traffic.  
This script runs on the source machine (SOURCE) and connects to the backup machine (BACKUP). [...]]]></description>
			<content:encoded><![CDATA[<p>This script performs a network backup using unix&#8217;s rsync command over ssh.  It performs an incremental backup, which means that it only updates new files and files that have changed since the last backup, thus minimizing network traffic.  </p>
<p>This script runs on the source machine (SOURCE) and connects to the backup machine (BACKUP).  (SOURCE->BACKUP). It assumes a user named backup-SOURCE on the backup machine and connects as that user. </p>
<p>One advantage of using SOURCE->BACKUP setup rather than a BACKUP->SOURCE method is that if your BACKUP server is compromised, the attacker will not be able to gain access to all of your production machines.</p>
<p>There are admittedly disadvantages to running a SOURCE->BACKUP setup, rather than a BACKUP->SOURCE setup.  One, you&#8217;ll need a copy of the script on each of the machines that you want to backup, making maintenance a bit more involved.  Second, if your SOURCE machine becomes compromised, the attacker will be able to gain access to your backup server. This second issue can be mitigated by setting the permissions properly on the BACKUP machine.  (This is why I use a separate user account for each machine that I backup.)</p>
<p>How to use this script:</p>
<ol>
<li>Edit the configuration options in the script.</li>
<li>Add a user called &#8220;backup-{$SOURCE} to the BACKUP machine.</li>
<li>Set up the appropriate SSH keys for the user to bypass password prompts.</li>
<li>Set up a cron job to run the script nightly.</li>
<li>If you want Apple-ish &#8220;time machine style&#8221; backups, set up a script to rotate the backups on the BACKUP machine.  I use this <a href="http://www.eddieoneverything.com/linux/rotating-backup-directories-using-cp-al-hardlinks-to-save-disk-space.php">rotate_backups.pl</a> script to make backups using cp -al (hardlinks).</li>
</ol>
<pre name="code" class="pl">

#!/usr/bin/perl
# Filename: rsync_backup.pl
# Will back things up from one computer to another over SSH using rsync.
# Use in conjunction with a rotate script on the destination machine for
# time-machine-like incremental backups.
# Note: SSH SSL auth keys must be installed on each end to avoid passwd prompt
# Assumes a user named "backup-$THIS_COMPUTER" on remote machine.
# All output will go to Logfile
#
# (c) 2009 eddie@eddieoneverything.com 

use Data::Dumper;

# This computer's name.  Used to name the backup files.
$THIS_COMPUTER = "yoakam";

# The remote machine's URL or IP address.
$REMOTE_MACHINE = "127.0.0.1";

# The backup directory on the remote machine
$REMOTE_BACKUP_LOCATION="/mnt/backup";

# Log things
$LOGFILE = "/var/log/rsync_backup";

# Directories to backup.
@BACKUP_DIRS=(
   '/home',
   '/root',
   '/etc',
   '/var/log',
   '/var/lib/mysql',
   '/var/spool/cron'
);

# Directories to ignore.
@IGNORE_DIRS=(
   '/home/lost+found',
   '/home/tmp',
   '/home/virtfs'
);

#####################################################
########### END Configuration options ###############
#####################################################

open hLOG, "&gt;&gt;$LOGFILE";
$now = `date`;
print hLOG "-" x 80, "\n";
print hLOG "START BACKUP $THIS_COMPUTER at $now\n" ;
print hLOG "-" x 80, "\n";
# Get a list of dirs to back up
foreach (@BACKUP_DIRS){
   $dir = $_;
   opendir(DIR, $dir) || alert ("cant opendir $dir: $!");
   while ($file = readdir(DIR)){
      if ($file ne '.' &amp;&amp; $file ne '..'){
         $my_file = $dir . "/" .  $file;
         if ( -d $my_file){
            if (grep {/$my_file/} @IGNORE_DIRS){
               print hLOG "Ignore Dir: $my_file\n";
            }else{
               print hLOG "Dir: $my_file\n";
               push @BACKUP_LIST, {'dir' =&gt; $dir, 'name'=&gt;$file};
            }
         }else{
            print hLOG "file is $my_file -- \n";
            @arr_temp =  ($dir, $my_file);
            push @BACKUP_LIST, {'dir' =&gt; $dir, 'name'=&gt;$file};
         }
      }
   }
   closedir DIR;
}

#print Dumper(@BACKUP_LIST);

#Back up each dir in the backup list
foreach $my_entry (@BACKUP_LIST){
   $dir = $my_entry-&gt;{'dir'};
   $b = $my_entry-&gt;{'name'};

   $cmd = "rsync -avz --delete-after -e ssh \"$dir/$b\" backup-$THIS_COMPUTER\@$REMOTE_MACHINE:\"/$REMOTE_BACKUP_LOCATION/$THIS_COMPUTER$dir\"";
   $now=`date`;
   print hLOG "\n$now\t$cmd ";
   #print "$cmd\n";
   `$cmd &gt;&gt; $LOGFILE 2&gt;&amp;1`;
}

$now = `date`;
print hLOG "-" x 80, "\n";
print hLOG "END BACKUP of $THIS_COMPUTER at $now\n" ;
print hLOG "-" x 80, "\n";
close hLOG;

###################### Subs #########################
sub alert(){
   $a=shift(@_);
   print hLOG "#############################\n";
   print hLOG "#############################\n";
   print hLOG "#############################\n";
   print hLOG "Cannot backup $a $!\n";
   print hLOG "#############################\n";
   print hLOG "#############################\n";
   print hLOG "#############################\n";
}</pre>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://www.eddieoneverything.com/linux/rotating-backup-directories-using-cp-al-hardlinks-to-save-disk-space.php" title="Rotating Backup Directories using cp -al (hardlinks) to Save Disk Space">Rotating Backup Directories using cp -al (hardlinks) to Save Disk Space</a></li><li><a href="http://www.eddieoneverything.com/articles/managing-server-load-when-unzipping-many-large-files.php" title="Managing Server Load when unzipping many large files">Managing Server Load when unzipping many large files</a></li><li><a href="http://www.eddieoneverything.com/linux/argument-list-too-long-from-rm-command-a-perl-script-to-get-around-the-problem.php" title="&#8220;Argument list too long&#8221; from rm command.   A Perl Script to Get Around the Problem">&#8220;Argument list too long&#8221; from rm command.   A Perl Script to Get Around the Problem</a></li><li><a href="http://www.eddieoneverything.com/articles/how-to-scan-a-computer-for-open-ports.php" title="How to Scan a Computer for Open Ports">How to Scan a Computer for Open Ports</a></li><li><a href="http://www.eddieoneverything.com/articles/the-zen-of-taco-bell-programming-using-unix-tools-to-prevent-reinventing-the-wheel.php" title="The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel">The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel</a></li><li><a href="http://www.eddieoneverything.com/programming/how-to-easily-install-a-perl-module-in-ubuntu-linux.php" title="How to Easily Install a Perl Module In Ubuntu Linux">How to Easily Install a Perl Module In Ubuntu Linux</a></li><li><a href="http://www.eddieoneverything.com/articles/linux-forward-file-not-working-make-sure-you-have-the-permissions-set-correctly.php" title="Linux .forward file not working?  Make sure you have the permissions set correctly">Linux .forward file not working?  Make sure you have the permissions set correctly</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.eddieoneverything.com/linux/using-rsync-ssh-to-backup-files-between-linux-machines-perl.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Argument list too long&#8221; from rm command.   A Perl Script to Get Around the Problem</title>
		<link>http://www.eddieoneverything.com/linux/argument-list-too-long-from-rm-command-a-perl-script-to-get-around-the-problem.php</link>
		<comments>http://www.eddieoneverything.com/linux/argument-list-too-long-from-rm-command-a-perl-script-to-get-around-the-problem.php#comments</comments>
		<pubDate>Sun, 15 Nov 2009 09:28:34 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rm]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.eddieoneverything.com/?p=329</guid>
		<description><![CDATA[You&#8217;ve seen the problem &#8211; many Unix commands don&#8217;t like very long argument lists.  For instance, my Linux machine complains when I try to &#8220;rm&#8221; 10,000 files at once:
[eddie@yoakam test]$ rm *
-bash: /bin/rm: Argument list too long
Here&#8217;s a simple script that will delete all of the files in a given directory, even if the argument [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;ve seen the problem &#8211; many Unix commands don&#8217;t like very long argument lists.  For instance, my Linux machine complains when I try to &#8220;rm&#8221; 10,000 files at once:</p>
<div class="q"><strong>[eddie@yoakam test]</strong>$ rm *<br />
-bash: /bin/rm: Argument list too long</div>
<p>Here&#8217;s a simple script that will delete all of the files in a given directory, even if the argument list gets really long. I prefer to keep it in my ~/bin directory named &#8220;bigrm&#8221;.</p>
<p>My bigrm Perl script:</p>
<pre name="code" class="perl">
#!/usr/bin/perl

if (!$ARGV[0]){
   print "Usage:  $0 \n";
   print "Will delete all files in specified directory\n";
   exit(1);
}

print "deleting files from $d\n";
$OUTDIR=$ARGV[0];

opendir(DIR, $OUTDIR) || die ("cant opendir $IMAGE_DIR: $!");
print "OPENED $OUTDIR\n";
while ($file = readdir(DIR)){
   if ($file!~/^\./){
      print "unlink $file\n";
      unlink ("$OUTDIR/$file");
   }
}
closedir(DIR)</pre>
<p>This is useful for cleaning out directories of temp files, of snapshot directories, etc.</p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://www.eddieoneverything.com/articles/how-to-scan-a-computer-for-open-ports.php" title="How to Scan a Computer for Open Ports">How to Scan a Computer for Open Ports</a></li><li><a href="http://www.eddieoneverything.com/articles/the-zen-of-taco-bell-programming-using-unix-tools-to-prevent-reinventing-the-wheel.php" title="The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel">The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel</a></li><li><a href="http://www.eddieoneverything.com/linux/rotating-backup-directories-using-cp-al-hardlinks-to-save-disk-space.php" title="Rotating Backup Directories using cp -al (hardlinks) to Save Disk Space">Rotating Backup Directories using cp -al (hardlinks) to Save Disk Space</a></li><li><a href="http://www.eddieoneverything.com/articles/managing-server-load-when-unzipping-many-large-files.php" title="Managing Server Load when unzipping many large files">Managing Server Load when unzipping many large files</a></li><li><a href="http://www.eddieoneverything.com/linux/using-rsync-ssh-to-backup-files-between-linux-machines-perl.php" title="Using rsync &#038; ssh to Backup Files Between Linux Machines (Perl)">Using rsync &#038; ssh to Backup Files Between Linux Machines (Perl)</a></li><li><a href="http://www.eddieoneverything.com/programming/how-to-easily-install-a-perl-module-in-ubuntu-linux.php" title="How to Easily Install a Perl Module In Ubuntu Linux">How to Easily Install a Perl Module In Ubuntu Linux</a></li><li><a href="http://www.eddieoneverything.com/articles/linux-forward-file-not-working-make-sure-you-have-the-permissions-set-correctly.php" title="Linux .forward file not working?  Make sure you have the permissions set correctly">Linux .forward file not working?  Make sure you have the permissions set correctly</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.eddieoneverything.com/linux/argument-list-too-long-from-rm-command-a-perl-script-to-get-around-the-problem.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Question: When does updatedb.mlocat / cron.daily run?</title>
		<link>http://www.eddieoneverything.com/linux/linux-question-when-does-updatedbmlocat-crondaily-run.php</link>
		<comments>http://www.eddieoneverything.com/linux/linux-question-when-does-updatedbmlocat-crondaily-run.php#comments</comments>
		<pubDate>Wed, 08 Apr 2009 14:39:37 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[locate]]></category>
		<category><![CDATA[mlocat]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[updatedb]]></category>
		<category><![CDATA[updatedb.mlocat]]></category>

		<guid isPermaLink="false">http://www.eddieoneverything.com/linux/linux-question-when-does-updatedbmlocat-crondaily-run.php</guid>
		<description><![CDATA[Uggh.  My Ubuntu server&#8217;s updatedb.mlocate process is loud as heck and runs *forever*.  
I haven&#8217;t noticed a performance decrease, as the job is set to run at a fairly low priority.  But since I sit near the server, it&#8217;s annoying to listen to the hard drive churn for hours and hours.  [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#468banner--><br />
Uggh.  My Ubuntu server&#8217;s updatedb.mlocate process is loud as heck and runs *forever*.  </p>
<p>I haven&#8217;t noticed a performance decrease, as the job is set to run at a fairly low priority.  But since I sit near the server, it&#8217;s annoying to listen to the hard drive churn for hours and hours.  All I wanted to do was re-schedule the job to run when I&#8217;m not around.  I figured that the job was being kicked off by root&#8217;s cron file, but I figured wrong.  </p>
<p>After some investigation, I learned the following:</p>
<ul>
<li>The job parameters are listed in /etc/cron.daily/mlocate.</li>
<blockquote><p>#! /bin/sh</p>
<p>set -e</p>
<p>[ -x /usr/bin/updatedb.mlocate ] || exit 0</p>
<p># See ionice(1)<br />
if [ -x /usr/bin/ionice ]; then<br />
    IONICE=&#8221;/usr/bin/ionice -c3&#8243;<br />
fi</p>
<p>$IONICE /usr/bin/updatedb.mlocate
</p></blockquote>
<li>The files in /etc/cron.daily are kicked off by /etc/crontab, not by root&#8217;s crontab.  For some reason, Ubuntu&#8217;s default install runs this process around 6am.  Changing this file allowed me to make the job run at 3am.  </li>
<blockquote><p># /etc/crontab: system-wide crontab<br />
# Unlike any other crontab you don&#8217;t have to run the `crontab&#8217;<br />
# command to install the new version when you edit this file<br />
# and files in /etc/cron.d. These files also have username fields,<br />
# that none of the other crontabs do.</p>
<p>SHELL=/bin/sh<br />
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin</p>
<p># m h dom mon dow user  command<br />
17 *  * * * root    cd / &#038;&#038; run-parts &#8211;report /etc/cron.hourly<br />
25 3  * * * root  test -x /usr/sbin/anacron || ( cd / &#038;&#038; run-parts &#8211;report /etc/cron.daily )<br />
47 3  * * 7 root  test -x /usr/sbin/anacron || ( cd / &#038;&#038; run-parts &#8211;report /etc/cron.weekly )<br />
52 3  1 * * root  test -x /usr/sbin/anacron || ( cd / &#038;&#038; run-parts &#8211;report /etc/cron.monthly )<br />
#</p></blockquote>
<li>updatedb can be configured to ignore certain paths &#8211; since my machine has a number of drives used for backups, I wanted to exclude those from the updatedb job.  I accomplished this by editing /etc/updatedb.conf and adding to the PRUNEPATHS listing.  Adding paths to the PRUNEPATHS option instructs updatedb to exclude those paths from indexing.</li>
<blockquote><p>
PRUNE_BIND_MOUNTS=&#8221;yes&#8221;<br />
PRUNEPATHS=&#8221;/tmp /var/spool /media /mnt/backup&#8221;<br />
PRUNEFS=&#8221;NFS nfs nfs4 afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf rpc_pipefs&#8221;</p></blockquote>
</ul>
<p><!--adsense#largerectanglenowrap--></p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://www.eddieoneverything.com/articles/linux-forward-file-not-working-make-sure-you-have-the-permissions-set-correctly.php" title="Linux .forward file not working?  Make sure you have the permissions set correctly">Linux .forward file not working?  Make sure you have the permissions set correctly</a></li><li><a href="http://www.eddieoneverything.com/linux/caution-filename-not-matched-error-when-unzipping-multiple-files-workaround.php" title="Caution: filename not matched error when unzipping multiple files workaround">Caution: filename not matched error when unzipping multiple files workaround</a></li><li><a href="http://www.eddieoneverything.com/articles/how-to-scan-a-computer-for-open-ports.php" title="How to Scan a Computer for Open Ports">How to Scan a Computer for Open Ports</a></li><li><a href="http://www.eddieoneverything.com/articles/the-zen-of-taco-bell-programming-using-unix-tools-to-prevent-reinventing-the-wheel.php" title="The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel">The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel</a></li><li><a href="http://www.eddieoneverything.com/linux/how-to-keep-an-ssh-connection-alive-in-linux.php" title="How To Keep An SSH Connection Alive in Linux">How To Keep An SSH Connection Alive in Linux</a></li><li><a href="http://www.eddieoneverything.com/linux/rotating-backup-directories-using-cp-al-hardlinks-to-save-disk-space.php" title="Rotating Backup Directories using cp -al (hardlinks) to Save Disk Space">Rotating Backup Directories using cp -al (hardlinks) to Save Disk Space</a></li><li><a href="http://www.eddieoneverything.com/linux/argument-list-too-long-from-rm-command-a-perl-script-to-get-around-the-problem.php" title="&#8220;Argument list too long&#8221; from rm command.   A Perl Script to Get Around the Problem">&#8220;Argument list too long&#8221; from rm command.   A Perl Script to Get Around the Problem</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.eddieoneverything.com/linux/linux-question-when-does-updatedbmlocat-crondaily-run.php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to stop VI / VIM from auto-indenting and auto-formatting</title>
		<link>http://www.eddieoneverything.com/linux/how-to-stop-vi-vim-from-auto-indenting-and-auto-formatting.php</link>
		<comments>http://www.eddieoneverything.com/linux/how-to-stop-vi-vim-from-auto-indenting-and-auto-formatting.php#comments</comments>
		<pubDate>Tue, 03 Mar 2009 16:05:57 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.eddieoneverything.com/linux/how-to-stop-vi-vim-from-auto-indenting-and-auto-formatting.php</guid>
		<description><![CDATA[Vim is the best editor in the world.  Maybe even the best piece of software ever written.  Unfortunately, Ubuntu Linux ships with a really annoying default installation &#8211; it auto-indents, it annoyingly highlights matching punctuation, doesn&#8217;t support syntax highlighting, etc.  If you&#8217;ve ever tried to paste something into VIM, you know what [...]]]></description>
			<content:encoded><![CDATA[<p>Vim is the best editor in the world.  Maybe even the best piece of software ever written.  Unfortunately, Ubuntu Linux ships with a really annoying default installation &#8211; it auto-indents, it annoyingly highlights matching punctuation, doesn&#8217;t support syntax highlighting, etc.  If you&#8217;ve ever tried to paste something into VIM, you know what I&#8217;m talking about &#8211; the formatting gets all mucked up.</p>
<p>Solve the problem using the options:</p>
<blockquote><p>:set paste</p></blockquote>
<blockquote><p>:set nopaste</p></blockquote>
<p><!--adsense#largerectanglenowrap--></p>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li><a href="http://www.eddieoneverything.com/bittorrent/gene-simmons-sex-tape-hits-the-internet-causes-a-torrent-of-uproar.php" title="Gene Simmons Tape hits the Internet, causes a torrent of uproar">Gene Simmons Tape hits the Internet, causes a torrent of uproar</a></li><li><a href="http://www.eddieoneverything.com/programming/mysql-performance-tip-on-duplicate-key-is-faster-than-insert-ignore-but-failing-with-a-duplicate-key-error-is-a-lot-faster.php" title="MySQL Performance Tip:  ON DUPLICATE KEY is faster than INSERT IGNORE, but failing with a duplicate key error is a lot faster">MySQL Performance Tip:  ON DUPLICATE KEY is faster than INSERT IGNORE, but failing with a duplicate key error is a lot faster</a></li><li><a href="http://www.eddieoneverything.com/articles/rockmelt-takes-privacy-seriously-but-you-cant-use-it-unless-you-share-all-of-your-personal-data-from-facebook.php" title="RockMelt takes privacy seriously, but you can&rsquo;t use it unless you share all of your personal data from Facebook">RockMelt takes privacy seriously, but you can&rsquo;t use it unless you share all of your personal data from Facebook</a></li><li><a href="http://www.eddieoneverything.com/apple/free-up-disk-space-on-your-mac-by-removing-unnecessary-osx-language-files.php" title="Free up Disk Space on your Mac by Removing unnecessary OSX language files">Free up Disk Space on your Mac by Removing unnecessary OSX language files</a></li><li><a href="http://www.eddieoneverything.com/lists/list-of-the-worlds-100-most-populated-metro-areas.php" title="List of the World&#8217;s 100 Most Populated Metro Areas">List of the World&#8217;s 100 Most Populated Metro Areas</a></li><li><a href="http://www.eddieoneverything.com/windows-xp/no-dell-i-dont-want-a-warranty-extension-but-you-already-knew-that-didnt-you-2.php" title="No, Dell, I don&#8217;t want a warranty extension.  But you already knew that, didn&#8217;t you?">No, Dell, I don&#8217;t want a warranty extension.  But you already knew that, didn&#8217;t you?</a></li><li><a href="http://www.eddieoneverything.com/programming/calculate-the-days-since-a-given-date-javascript.php" title="Calculate the Days Since a Given Date (Javascript)">Calculate the Days Since a Given Date (Javascript)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.eddieoneverything.com/linux/how-to-stop-vi-vim-from-auto-indenting-and-auto-formatting.php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to do a search and replace in multiple files using Perl</title>
		<link>http://www.eddieoneverything.com/linux/how-to-do-a-search-and-replace-in-multiple-files-using-perl.php</link>
		<comments>http://www.eddieoneverything.com/linux/how-to-do-a-search-and-replace-in-multiple-files-using-perl.php#comments</comments>
		<pubDate>Wed, 21 Jan 2009 22:48:38 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.eddieoneverything.com/linux/how-to-do-a-search-and-replace-in-multiple-files-using-perl.php</guid>
		<description><![CDATA[Over the years, I&#8217;ve written a number of &#8220;search and replace in multiple files&#8221; scripts.   Working on a computer that didn&#8217;t have my standard, custom toolset available, I found myself searching for an alternative.
Found this tip over at Dzone Snippets &#8211; do it all with a single line of perl.
perl -pi -w -e [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#468banner--></p>
<p>Over the years, I&#8217;ve written a number of &#8220;search and replace in multiple files&#8221; scripts.   Working on a computer that didn&#8217;t have my standard, custom toolset available, I found myself searching for an alternative.</p>
<p>Found this tip over at <a href="http://snippets.dzone.com/posts/show/506">Dzone</a> Snippets &#8211; do it all with a single line of perl.</p>
<blockquote><p>perl -pi -w -e &#8217;s/search/replace/g;&#8217; *.txt</p></blockquote>
<p>Of course, you&#8217;ll need Perl installed on your system and command line access to make use of it.</p>
<p><!--adsense#largerectanglenowrap--></p>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li><a href="http://www.eddieoneverything.com/articles/how-to-set-the-window-size-and-position-of-a-chrome-application-shortcut.php" title="How to Set the Window Size and Position of a Chrome Application Shortcut">How to Set the Window Size and Position of a Chrome Application Shortcut</a></li><li><a href="http://www.eddieoneverything.com/articles/stop-redplum-coupons-from-clogging-up-your-mailbox.php" title="Stop RedPlum Coupons from Clogging Up Your Mailbox">Stop RedPlum Coupons from Clogging Up Your Mailbox</a></li><li><a href="http://www.eddieoneverything.com/articles/what-is-the-pound-sign-in-front-of-peoples-names-on-facebook.php" title="What Is The # (Pound) Sign in Front of People&#8217;s Names on Facebook">What Is The # (Pound) Sign in Front of People&#8217;s Names on Facebook</a></li><li><a href="http://www.eddieoneverything.com/business-tips/tip-on-renting-office-space-the-quoted-rate-may-be-per-year.php" title="Tip on Renting Office Space &#8211; The Quoted Rate May Be Per-Year">Tip on Renting Office Space &#8211; The Quoted Rate May Be Per-Year</a></li><li><a href="http://www.eddieoneverything.com/science/iq-score-range-by-occupation.php" title="I.Q. Score Range By Occupation">I.Q. Score Range By Occupation</a></li><li><a href="http://www.eddieoneverything.com/articles/how-to-properly-thaw-or-defrost-chicken-in-a-few-hours.php" title="How to Properly Thaw or Defrost Chicken in a Few Hours">How to Properly Thaw or Defrost Chicken in a Few Hours</a></li><li><a href="http://www.eddieoneverything.com/internet/how-to-reveal-stored-passwords-in-firefox-chrome-safari-and-ie.php" title="How To Reveal Stored Passwords in Firefox, Chrome, Safari, and IE">How To Reveal Stored Passwords in Firefox, Chrome, Safari, and IE</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.eddieoneverything.com/linux/how-to-do-a-search-and-replace-in-multiple-files-using-perl.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux fatal error: updatedb: create_db(): chdir: No such file or directory</title>
		<link>http://www.eddieoneverything.com/linux/linux-fatal-error-updatedb-create_db-chdir-no-such-file-or-directory.php</link>
		<comments>http://www.eddieoneverything.com/linux/linux-fatal-error-updatedb-create_db-chdir-no-such-file-or-directory.php#comments</comments>
		<pubDate>Tue, 02 Dec 2008 21:45:23 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.eddieoneverything.com/linux/linux-fatal-error-updatedb-create_db-chdir-no-such-file-or-directory.php</guid>
		<description><![CDATA[Got this error when running updatedb from a Red Had Linux command prompt:
fatal error: updatedb: create_db(): chdir: No such file or directory
The problem:
[root@iberia george]# fatal error: updatedb: create_db(): chdir: No such file or directory
As you can see, I&#8217;m running as root, so this shouldn&#8217;t be a permissions problem.  Probably a file lock or corrupt [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#largerectanglenowrap--></p>
<p>Got this error when running updatedb from a Red Had Linux command prompt:<br />
<code>fatal error: updatedb: create_db(): chdir: No such file or directory</code></p>
<p><strong>The problem:</strong><br />
[root@iberia george]# fatal error: updatedb: create_db(): chdir: No such file or directory</p>
<p>As you can see, I&#8217;m running as root, so this shouldn&#8217;t be a permissions problem.  Probably a file lock or corrupt database problem.</p>
<p><strong>The cause: </strong> Many people get this error when the slocate database becomes corrupt.</p>
<p><strong>The Fix: </strong> First, if you&#8217;re running two instances of updatedb at once, quit doing that.  :)   Second, try removing and re-creating the database, as <a href="http://bugs.gentoo.org/37794">someone advises</a> in a Gentoo linux forum:</p>
<p>Remove contents of /var/lib/slocate/  using<br />
<code>[root@iberia george]# rm /var/lib/slocate/*</code></p>
<p>Then re-run updatedb<br />
<code>[root@iberia george]# updatedb -u</code></p>
<p>This should fix the problem.</p>
<p><!--adsense#largerectanglenowrap--></p>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li><a href="http://www.eddieoneverything.com/articles/asco-super-stainless-razor-blade-review.php" title="Asco Super Stainless Razor Blade Review">Asco Super Stainless Razor Blade Review</a></li><li><a href="http://www.eddieoneverything.com/legal/judge-kent-order-denying-motion-to-transfer-in-case-smith-v-colonial-penn.php" title="Judge Kent order denying Motion to Transfer in case Smith v. Colonial Penn">Judge Kent order denying Motion to Transfer in case Smith v. Colonial Penn</a></li><li><a href="http://www.eddieoneverything.com/articles/getting-windows-live-writer-to-show-your-template-properly.php" title="Getting Windows Live Writer to Show Your Template Properly">Getting Windows Live Writer to Show Your Template Properly</a></li><li><a href="http://www.eddieoneverything.com/articles/opera-changes-third-party-iframe-cookie-handing-in-latest-release.php" title="Opera changes third-party iframe cookie handing in latest release">Opera changes third-party iframe cookie handing in latest release</a></li><li><a href="http://www.eddieoneverything.com/linux/how-to-stop-vi-vim-from-auto-indenting-and-auto-formatting.php" title="How to stop VI / VIM from auto-indenting and auto-formatting">How to stop VI / VIM from auto-indenting and auto-formatting</a></li><li><a href="http://www.eddieoneverything.com/sports/historical-list-of-kentucky-derby-winners.php" title="Historical List of Kentucky Derby Winners">Historical List of Kentucky Derby Winners</a></li><li><a href="http://www.eddieoneverything.com/calculators/blimpie-sub-calorie-calculator.php" title="Blimpie Sub Calorie Calculator">Blimpie Sub Calorie Calculator</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.eddieoneverything.com/linux/linux-fatal-error-updatedb-create_db-chdir-no-such-file-or-directory.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux / WHM / Cpanel : Resource temporarily unavailable</title>
		<link>http://www.eddieoneverything.com/linux/linux-whm-cpanel-resource-temporarily-unavailable.php</link>
		<comments>http://www.eddieoneverything.com/linux/linux-whm-cpanel-resource-temporarily-unavailable.php#comments</comments>
		<pubDate>Mon, 24 Nov 2008 02:09:52 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[fork bomb]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[system resources]]></category>
		<category><![CDATA[ulimit]]></category>
		<category><![CDATA[whm]]></category>

		<guid isPermaLink="false">http://www.eddieoneverything.com/linux/linux-whm-cpanel-resource-temporarily-unavailable.php</guid>
		<description><![CDATA[Getting this Linux error message?
Resource temporarily unavailable
It&#8217;s because your system is limiting the number of files / processes / CPU that your particular user ID can use.
If you use WHM/Cpanel, enabling the &#8220;Shell fork bomb protection&#8221; can make the &#8220;Resource temporarily unavailable&#8221; message appear more often.
Don&#8217;t disable the shell fork bomb protection &#8211; it&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#largerectanglenowrap--></p>
<p>Getting this Linux error message?</p>
<p>Resource temporarily unavailable</p>
<p>It&#8217;s because your system is limiting the number of files / processes / CPU that your particular user ID can use.</p>
<p>If you use WHM/Cpanel, enabling the &#8220;Shell fork bomb protection&#8221; can make the &#8220;Resource temporarily unavailable&#8221; message appear more often.</p>
<p>Don&#8217;t disable the shell fork bomb protection &#8211; it&#8217;s a good thing.  After all, do you want any jackass user to be able to write a perl script containing the line &#8220;while (fork());&#8221;  and bring your system to its knees?</p>
<p>Instead, consider raising the limits for individual trusted users using ulimit.  (You will need root access to do this.)</p>
<p>Make the following changes in the system shell init files.</p>
<p><code>(these files)<br />
/etc/profile<br />
/etc/bashrc<br />
/etc/profile.d/limits.sh<br />
</code></p>
<p><code>if [ "$LIMITUSER" = "root" ]; then<br />
ulimit -n 4096 -u 14335 -m unlimited -d unlimited -s 8192 -c 1000000 -v unlimited 2&gt;/dev/null<br />
elif [ "$LIMITUSER" = "YOUR USER NAME" ]; then<br />
ulimit -n 4096 -u 14335 -m unlimited -d unlimited -s 8192 -c 1000000 -v unlimited 2&gt;/dev/null<br />
else<br />
ulimit -n 100 -u 20 -m 200000 -d 200000 -s 8192 -c 200000 -v 200000 2&gt;/dev/null<br />
fi<br />
</code></p>
<p><!--adsense#largerectanglenowrap--></p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://www.eddieoneverything.com/internet/cpanel-problem-parking-domain-using-a-remote-nameserver.php" title="Cpanel problem parking domain using a remote nameserver">Cpanel problem parking domain using a remote nameserver</a></li><li><a href="http://www.eddieoneverything.com/articles/linux-forward-file-not-working-make-sure-you-have-the-permissions-set-correctly.php" title="Linux .forward file not working?  Make sure you have the permissions set correctly">Linux .forward file not working?  Make sure you have the permissions set correctly</a></li><li><a href="http://www.eddieoneverything.com/articles/managing-server-load-when-unzipping-many-large-files.php" title="Managing Server Load when unzipping many large files">Managing Server Load when unzipping many large files</a></li><li><a href="http://www.eddieoneverything.com/linux/caution-filename-not-matched-error-when-unzipping-multiple-files-workaround.php" title="Caution: filename not matched error when unzipping multiple files workaround">Caution: filename not matched error when unzipping multiple files workaround</a></li><li><a href="http://www.eddieoneverything.com/articles/how-to-scan-a-computer-for-open-ports.php" title="How to Scan a Computer for Open Ports">How to Scan a Computer for Open Ports</a></li><li><a href="http://www.eddieoneverything.com/articles/the-zen-of-taco-bell-programming-using-unix-tools-to-prevent-reinventing-the-wheel.php" title="The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel">The Zen of Taco Bell Programming &#8211; Using Unix Tools to Prevent Reinventing the Wheel</a></li><li><a href="http://www.eddieoneverything.com/linux/how-to-keep-an-ssh-connection-alive-in-linux.php" title="How To Keep An SSH Connection Alive in Linux">How To Keep An SSH Connection Alive in Linux</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.eddieoneverything.com/linux/linux-whm-cpanel-resource-temporarily-unavailable.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

