vim error “Cannot create backup file, (use ! to override)”

I saw the following error message today on one of our nagios servers
when i tried to save a file in vim.

Cannot create backup file, (use ! to override)

The uptime of this server was about 300 days.

I checked the amount of files in /tmp

nagios:~# ls /tmp | wc -l
889578

i then tried to delete the files without any luck:

nagios:/tmp# rm cor*
-bash: /bin/rm: Argument list too long

The solution:

i created a small bash script (del.sh)

#!/bin/sh
for FILE in `ls`
do
rm $FILE
done

made it executable with

chmod +x del.sh

started the script

nagios:/tmp# ./del.sh

bye, bye:

nagios:/tmp# ls /tmp | wc -l
1

Time to restart nagios with
nagios:/tmp# /etc/init.d/nagios start
Starting nagios: done.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s