LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-21-2007, 08:02 AM   #1
upwordz
LQ Newbie
 
Registered: May 2007
Location: Portland Maine
Distribution: Red Hat 2.6.9-34.EL, FC3, Cent5
Posts: 8

Rep: Reputation: 0
What are these files and can I delete them?


So we ran out of space on a development server we have. I used this command to find a list of large files: find / -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'

Below is the output of the above command followed by the output of df and two directories that are the most troublesome (/root/import/export/ and /usr/local/mysql/var/)

I dont know what files are safe move to the data directory and which are safe to delete. I'm pretty sure that database.sql.gz gets overwritten daily by rsync. Appreciate any advice.

[root@tfl_dev][/]> find / -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
/proc/kcore: 1016M
/var/www/data/tfl/site/images/originals/ra1180_34shot.jpg: 24M
/var/www/data/tfl/secure/images/originals/ra1180_34shot.jpg: 24M
/var/www/data/tfl/database.sql.gz: 179M
/var/lib/rpm/Packages: 22M
/data/toolsforless.sql.old: 251M
/root/import/export/php-4.3.9.tar: 25M
/root/import/export/ImageMagick-6.3.0-0.tar: 31M
/root/import/export/mysql-standard-4.1.22-pc-linux-gnu-i686.tar.gz: 49M
/root/import/export/httpd-2.0.59.tar: 27M
/root/import/export/xorg-x11-6.8.1-12.src.rpm: 52M
/root/import/export/mysql-standard-4.1.22-pc-linux-gnu-i686.tar: 148M
/usr/local/mysql/var/ibdata1: 1.3G
/usr/local/mysql/var/localhost-bin.000009: 1.1G
/usr/local/mysql/var/localhost-bin.000008: 1008M
/usr/local/mysql/var/localhost-bin.000012: 1.1G
/usr/local/mysql/var/localhost-bin.000013: 1.1G
/usr/local/mysql/var/localhost-bin.000007: 60M
/usr/local/mysql/var/localhost-bin.000002: 1.1G
/usr/local/mysql/var/localhost-bin.000023: 1.1G
/usr/local/mysql/var/tfl/item_view_count.MYD: 28M
/usr/local/mysql/var/tfl/gtrack_crawler_page_stats.MYD: 68M
/usr/local/mysql/var/tfl/gtrack_crawler_page_stats.MYI: 80M
/usr/local/mysql/var/localhost-bin.000027: 1.1G
/usr/local/mysql/var/localhost-bin.000028: 1.1G
/usr/local/mysql/var/localhost-bin.000029: 190M
/usr/local/mysql/var/localhost-bin.000011: 1.1G
/usr/local/mysql/var/localhost-bin.000022: 1.1G
/usr/local/mysql/var/localhost-bin.000003: 1.1G
/usr/local/mysql/var/localhost-bin.000006: 1.1G
/usr/local/mysql/var/localhost-bin.000020: 1.1G
/usr/local/mysql/var/localhost-bin.000021: 1.1G
/usr/local/mysql/var/localhost-bin.000025: 880M
/usr/local/mysql/var/localhost-bin.000019: 1.1G
/usr/local/mysql/var/localhost-bin.000005: 1.1G
/usr/local/mysql/var/localhost-bin.000014: 1.1G
/usr/local/mysql/var/localhost-bin.000017: 1.1G
/usr/local/mysql/var/localhost-bin.000010: 1.1G
/usr/local/mysql/var/localhost-bin.000024: 1.1G
/usr/local/mysql/var/old_tfl/gtrack_crawler_page_stats.MYD: 47M
/usr/local/mysql/var/old_tfl/gtrack_crawler_page_stats.MYI: 54M
/usr/local/mysql/var/localhost-bin.000001: 1.1G
/usr/local/mysql/var/localhost-bin.000018: 1.1G
/usr/local/mysql/var/localhost-bin.000016: 1.1G
/usr/local/mysql/var/localhost-bin.000015: 1.1G
/usr/local/mysql/var/localhost-bin.000004: 1.1G
/usr/lib/gcc/i386-redhat-linux/3.4.2/libgcj.a: 23M
/usr/lib/locale/locale-archive: 37M
/usr/share/comps/i386/hdlist2: 23M
/usr/src/redhat/SOURCES/xorg-x11-6.8.1.tar.gz: 53M


[root@tfl_dev][/]> df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 39G 37G 0 100% /
/dev/sda3 70G 336M 66G 1% /data
none 502M 0 502M 0% /dev/shm


[root@tfl_dev][~/import/export]> ls -al
total 388868
drwxr-xr-x 15 root root 4096 Jan 4 10:47 .
drwxr-xr-x 3 root root 4096 Dec 7 14:29 ..
drwxrwxrwx 8 1000 1000 4096 Dec 11 15:31 curl-7.14.0
-rw-r--r-- 1 root root 2236640 May 16 2005 curl-7.14.0.tar.gz
drwxrwxrwx 8 1000 1000 4096 Dec 8 15:55 curl-7.16.0
-rw-r--r-- 1 root root 1949897 Oct 30 2006 curl-7.16.0.tar.gz
drwxr-xr-x 8 1000 users 4096 Dec 11 14:51 freetype-2.2.1
-rw-r--r-- 1 root root 1649382 May 12 2006 freetype-2.2.1.tar.gz
drwxr-xr-x 12 admin admin 4096 Dec 7 15:12 httpd-2.0.59
-rw-r--r-- 1 root root 28303360 Dec 7 15:07 httpd-2.0.59.tar
-rw-r--r-- 1 root root 6122149 Dec 7 14:31 httpd-2.0.59.tar.gz
-rw-r--r-- 1 root root 31774720 Dec 7 14:41 ImageMagick-6.3.0-0.tar
drwxr-xr-x 2 301 users 12288 Dec 11 16:21 jpeg-6b
-rw-r--r-- 1 root root 613261 Jun 28 2001 jpegsrc.v6b.tar.gz
drwxrwxrwx 7 admin adm 4096 Dec 11 14:59 libmcrypt-2.5.7
-rw-r--r-- 1 root root 523321 Dec 7 14:42 libmcrypt-2.5.7.tar.gz
drwxr-xr-x 6 1004 101 4096 Dec 11 15:39 libpng-1.2.14
-rw-r--r-- 1 root root 828377 Nov 28 11:31 libpng-1.2.14.tar.gz
drwxrwxrwx 6 admin adm 4096 Dec 11 14:57 mcrypt-2.6.4
-rw-r--r-- 1 root root 383865 Dec 7 14:30 mcrypt-2.6.4.tar.gz
-rw-r--r-- 1 root root 1135512 Dec 7 14:32 mhash-0.9.7.1.tar.gz
drwxrwxrwx 38 503 users 4096 Jan 4 10:53 mysql-4.1.22
-rw-r--r-- 1 root root 17761101 Nov 2 2006 mysql-4.1.22.tar.gz
-rw-r--r-- 1 root root 17653360 Nov 23 08:18 MySQL-standard-4.1.22-0.rhel3.src.rpm
-rw-r--r-- 1 root root 155146240 Dec 7 15:43 mysql-standard-4.1.22-pc-linux-gnu-i686.tar
-rw-rw-r-- 1 admin admin 50615097 Dec 7 15:36 mysql-standard-4.1.22-pc-linux-gnu-i686.tar.gz
drwxr-xr-x 18 1003 1003 4096 Dec 11 20:05 php-4.3.9
-rw-r--r-- 1 root root 26081280 Dec 7 14:35 php-4.3.9.tar
-rw-r--r-- 1 root root 810 Dec 8 16:04 php-config-command-2clean.txt
-rw-r--r-- 1 root root 922 Dec 11 20:01 php-config-command-clean.txt
-rw-r--r-- 1 root root 985 Dec 7 15:35 php-config-command.txt
-rw-r--r-- 1 root root 38484 Dec 7 14:41 php.ini
drwxr-xr-x 2 root root 4096 Dec 7 15:03 rpm
-rw-r--r-- 1 root root 54403082 Dec 11 19:32 xorg-x11-6.8.1-12.src.rpm
drwxrwxr-x 6 1618 16 4096 Mar 19 1998 xpm-3.4k
drwxrwxr-x 6 1618 16 4096 Mar 19 1998 xpm-3.4k-linux
-rw-r--r-- 1 root root 77315 Mar 19 1998 xpm-3.4k-linux.tgz
-rw-r--r-- 1 root root 148887 Mar 19 1998 xpm-3.4k.tar.gz



[root@tfl_dev][/usr/local/mysql/var]> ls -alh
total 28G
drwx------ 6 mysql mysql 4.0K May 12 02:30 .
drwxr-xr-x 12 root mysql 4.0K Jan 4 11:05 ..
-rw-rw---- 1 mysql mysql 1.3G May 12 02:32 ibdata1
-rw-rw---- 1 mysql mysql 5.0M May 12 02:32 ib_logfile0
-rw-rw---- 1 mysql mysql 5.0M May 12 02:32 ib_logfile1
-rw-rw---- 1 mysql mysql 1.1G Feb 5 02:32 localhost-bin.000001
-rw-rw---- 1 mysql mysql 1.1G Feb 7 02:33 localhost-bin.000002
-rw-rw---- 1 mysql mysql 1.1G Feb 9 02:34 localhost-bin.000003
-rw-rw---- 1 mysql mysql 1.1G Feb 11 02:34 localhost-bin.000004
-rw-rw---- 1 mysql mysql 1.1G Feb 13 02:35 localhost-bin.000005
-rw-rw---- 1 mysql mysql 1.1G Feb 16 02:30 localhost-bin.000006
-rw-rw---- 1 mysql mysql 60M Feb 27 12:44 localhost-bin.000007
-rw-rw---- 1 mysql mysql 1008M Mar 1 14:07 localhost-bin.000008
-rw-rw---- 1 mysql mysql 1.1G Mar 4 02:30 localhost-bin.000009
-rw-rw---- 1 mysql mysql 1.1G Mar 6 02:30 localhost-bin.000010
-rw-rw---- 1 mysql mysql 1.1G Mar 8 02:30 localhost-bin.000011
-rw-rw---- 1 mysql mysql 1.1G Mar 10 02:30 localhost-bin.000012
-rw-rw---- 1 mysql mysql 1.1G Mar 12 02:30 localhost-bin.000013
-rw-rw---- 1 mysql mysql 1.1G Mar 14 02:30 localhost-bin.000014
-rw-rw---- 1 mysql mysql 1.1G Mar 15 02:34 localhost-bin.000015
-rw-rw---- 1 mysql mysql 1.1G Mar 17 02:35 localhost-bin.000016
-rw-rw---- 1 mysql mysql 1.1G Mar 19 02:35 localhost-bin.000017
-rw-rw---- 1 mysql mysql 1.1G Mar 21 02:34 localhost-bin.000018
-rw-rw---- 1 mysql mysql 1.1G Mar 23 02:34 localhost-bin.000019
-rw-rw---- 1 mysql mysql 1.1G Mar 25 02:33 localhost-bin.000020
-rw-rw---- 1 mysql mysql 1.1G Mar 27 02:33 localhost-bin.000021
-rw-rw---- 1 mysql mysql 1.1G Mar 29 02:33 localhost-bin.000022
-rw-rw---- 1 mysql mysql 1.1G Mar 31 02:32 localhost-bin.000023
-rw-rw---- 1 mysql mysql 1.1G Apr 2 02:32 localhost-bin.000024
-rw-rw---- 1 mysql mysql 880M Apr 3 14:34 localhost-bin.000025
-rw-rw---- 1 mysql mysql 1.1K May 8 00:02 localhost-bin.000026
-rw-rw---- 1 mysql mysql 1.1G May 9 02:34 localhost-bin.000027
-rw-rw---- 1 mysql mysql 1.1G May 12 02:30 localhost-bin.000028
-rw-rw---- 1 mysql mysql 190M May 21 12:52 localhost-bin.000029
-rw-rw---- 1 mysql mysql 506 May 12 02:30 localhost-bin.index
-rw-rw---- 1 mysql root 12K May 21 12:52 localhost.localdomain.err
-rw-rw---- 1 mysql mysql 5 May 7 23:54 localhost.localdomain.pid
drwx------ 2 mysql mysql 4.0K Jan 4 11:05 mysql
drwx------ 2 mysql mysql 16K Jan 23 13:51 old_tfl
drwx------ 2 mysql mysql 4.0K Jan 4 11:05 test
drwx------ 2 mysql mysql 20K May 13 02:30 tfl
 
Old 05-21-2007, 08:35 AM   #2
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Manjaro
Posts: 963

Rep: Reputation: 36
where you have a file with .tar.gz and another with the same name that is just .tar
the .tar.gz one is normally safe to delete, as it is only a compressed version of the tar file...


apart form that i would empasise extreame caution when doing things to files that you diddnt create in the first place.

eg if you delete /var/lib/rpm/pakages you will totally mess up your pakage manager.



to free up space i woudl recomend fireing up your pakage manager and deslecting things that yoyu wont be needing, eg. as your box is a developemant server do you really need the games taht are likly installed by default?

your pakage manager will be able to sort out the dependancys for you and should not break things if you only uninstall thinsg that you know you wont use



either that or just add some more hardrive space pure and simple,
its not as if hard drives are expensive anymore
 
Old 05-21-2007, 11:35 AM   #3
upwordz
LQ Newbie
 
Registered: May 2007
Location: Portland Maine
Distribution: Red Hat 2.6.9-34.EL, FC3, Cent5
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks dasy,

We've purchased a new drive which runs on sata II but we're getting a kernel error (I dont have the error handy). We think it may be a bios setting or a setting on the motherboard.

I've moved all the zipped files which free'd up 250MB. I talked to a couple people about the giant mysql files and we think they are backups based on the mod dates. Once confirmed, we will set up a cron to start eliminating all but the most recent backup on a daily basis.

Thanks for the help!
 
Old 05-22-2007, 06:34 AM   #4
upwordz
LQ Newbie
 
Registered: May 2007
Location: Portland Maine
Distribution: Red Hat 2.6.9-34.EL, FC3, Cent5
Posts: 8

Original Poster
Rep: Reputation: 0
Turns out those mysql files (/usr/local/mysql/var/localhost-bin.000001 and so forth) are binary update logs. Here's a snippet...

[snippet]
The binary update log is activated by placing
log-bin[=binary_update_log_filename]
in your configuration file (you should know where that is by now!). The filename is optional, and if you do not supply it, the log will be named hostname-bin, with hostname being the name of the host. Any extension (the last 3 letters after the dot) you supply will be dropped, as MySQL creates its own, starting at 001. This log stores all updates to the database in an efficient binary format (the deprecated Update Log stores the same data in a less compressed format). The binary log stores each SQL statement that makes a change to the database in the same order as they were executed, and for this reason is useful for restoring backups, or for replication. MySQL comes with an executable binary that allows you to view the contents of the binary update log; (since it is a binary format, viewing it in a text editor is no use). It's called mysqlbinlog, and can be accessed as follows, to view the sample binary update log.
[/snippet]

Hope this helps others!

Cheers!
 
Old 05-23-2007, 08:14 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
Actully, if you've got xxx.tar and xxx.tar.gz, keep the gzipped one, it'll be smaller....
Also, looks like a lot of those (.tar.gz) also have same-named dirs. IOW, when the xxx.tar.gz was unzipped/untarred, it installed itself into the named dir.
Therefore, you don't technically need the .tar.gz file anymore (although you might want to back them up before deletion).
In fact, if you are unsure about any(!) file, back it up first. That way you can always put it back if you're wrong, but make a note for future ref, so you know which ones are good to go.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete files that won't delete? di11rod Linux - Security 7 10-19-2005 09:14 PM
how can I do to delete these files? tuzhiyong Linux - Software 2 12-02-2004 11:01 AM
how do you delete files? otoomet Linux - General 6 11-12-2004 04:06 AM
How to delete the destination files while the source files deleted in cp -u ? myunicom Linux - General 4 09-26-2003 01:13 PM
Delete Files bsengland Linux - Newbie 1 11-04-2002 05:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration