Sponsored Content
Top Forums Shell Programming and Scripting Need script to remove millions of tmp files in /html/cache/ directory Post 302519561 by methyl on Wednesday 4th of May 2011 09:37:59 AM
Old 05-04-2011
Can we get a more exact sizing of the problem:

How big is the directory file itself?
Code:
ls -lad /html/cache

How long does it take to traverse the tree? And how many files in the tree?
Code:
date ; find /html/cache/ -type f -print | wc -l  ; date


Can you expand a bit about your CentOS VPS?
Are you renting a virtual computer from somewhere on the internet, or is this something you manage yourself?

If this is long-distance, the volume of output from commands must be important, but I can't see how running file deletes can hang the VPS. This is assuming that there is no rollback facility or something which would be crippled by high volumes of file deletes. I must assume that it did not collapse when the files were created - which is surely a similar load.

Assuming /html/cache is a simple directory structure and can be quiesced with no files open I'd be tempted to rename the directory, create a new replacement with identical permissions, and then delete the original at my leisure.

Last edited by methyl; 05-09-2011 at 09:18 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to remove all empty files within the directory structure?

Hi I need to write a shell script which basically searches for all the empty files within the directory structure, lists them before asking the user to confirm if they would like to delete them. If the user deletes the file then a notice would appear confirming the file is deleted. I've be... (5 Replies)
Discussion started by: cat123
5 Replies

2. Shell Programming and Scripting

perl script related /tmp directory

hi friends. i have to make a perl script to generate all users and space(how much they are using) and files(how much files they have) and time(how much time that accessed /tmp buffer) from /tmp directory. please provide me guidance. regards pranesh b. mishra (2 Replies)
Discussion started by: praneshmishra08
2 Replies

3. Web Development

html link to images in /tmp directory

Because of permission issues, I need to link to images in my web page which are stored in /tmp which of course is located in the root directory but my actual html page is much further down in another directory. I thought the the following code should work, but the image comes up as a broken link:... (2 Replies)
Discussion started by: Solerous
2 Replies

4. Shell Programming and Scripting

Script That Can navigate to 3 differents directory & remove files under them

Hi I am Trying to Write a script that can goto 4 different directorys on the server & remove the Files older then 30 days ?? /logs logs1 logs2 logs3 Now I need to remove files under logs1 logs2 logs3 which are older then 30 days whose name stat 'sit' , 'mig','bld' . in... (3 Replies)
Discussion started by: Beginner123
3 Replies

5. Shell Programming and Scripting

How to remove urls from html files

Does anybody know how to remove all urls from html files? all urls are links with anchor texts in the form of <a href="http://www.anydomain.com">ANCHOR</a> they may start with www or not. Goal is to delete all urls and keep the ANCHOR text and if possible to change tags around anchor to... (2 Replies)
Discussion started by: georgi58
2 Replies

6. Shell Programming and Scripting

Script to search for a character in files in a Directory & remove it

Hi All, Am new to both Unix & this Forum - Need some help on a script that I am trying to write: In a Directory i have few text files which might or might not contain some text that I am trying to find. Once that text is found in any of the files, it needs to be removed from the file ... (6 Replies)
Discussion started by: rituparna_gupta
6 Replies

7. UNIX for Dummies Questions & Answers

Redirecting tmp files of SORT into different directory

Hey Guys, I am facing an annoying scenario, fewer times when I execute the sort command, it throws out on error saying that "No Space on available on /var/tmp/<temp file name>. May be it is set to /var/tmp directory. I was wondering, if I cant redirect the temporary file creation to any other... (3 Replies)
Discussion started by: abhisheksunkari
3 Replies

8. UNIX for Dummies Questions & Answers

Script to remove zip files from a directory

Hi Folks, There is a job which generates a .zip files every day at /usr/app/generated directory , now please advise for the script that will delete this zip files permanently.but while deleting it should make sure that it will not delete the last two days recently generated zip files and this... (1 Reply)
Discussion started by: punpun66
1 Replies

9. Shell Programming and Scripting

Parse multiple html files in directory

I have downloaded source code for 97 files using: wget -x -i link.txt then run a rename loop: for file in * do mv $file $file.txt done to keep the html tags but make the file a text that can be parsed. In each of the 97 txt files the gene # is variable, but the gene is associated... (15 Replies)
Discussion started by: cmccabe
15 Replies

10. Shell Programming and Scripting

Shell script to find the GB files in /tmp directory in remote server

Hi, i need help on shell scripting. Main intention of the script is step 1: ssh to remote server Step 2: cd /tmp in remote server Step 3: in tmp i want to grep only files and directories which are in GB sizes All the servers list file is - tmpsrv.txt vi tmpsrv.txt ... (17 Replies)
Discussion started by: kumar85shiv
17 Replies
FC-CACHE(1)															       FC-CACHE(1)

NAME
fc-cache - build font information cache files SYNOPSIS
fc-cache [ -fsvV? ] [ --force ] [ --system-only ] [ --verbose ] [ --version ] [ --help ] [ dirs ] DESCRIPTION
fc-cache scans the font directories on the system and builds font information cache files for applications using fontconfig for their font handling. If directory arguments are not given, fc-cache uses each directory in the current font configuration. Each directory is scanned for font files readable by FreeType. A cache is created which contains properties of each font and the associated filename. This cache is used to speed up application startup when using the fontconfig library. Note that fc-cache must be executed once per architecture to generate font information customized for that architecture. On a subsequent run, fc-cache will augment the cache information files with the information for the new architecture. OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. -f --force Force re-generation of apparently up-to-date cache files, overriding the timestamp checking. -s --system-only Only scan system-wide directories, omitting the places located in the user's home directory. -v --verbose Display status information while busy. -? --help Show summary of options. -V --version Show version of the program and exit. dirs A list of directories to scan for fonts. FILES
fonts.cache-2 These files are generated by fc-cache and contain maps from file names to font properties. They are read by the fontconfig library at application startup to locate appropriate fonts. SEE ALSO
fc-list (1). The fontconfig user's guide, in HTML format: /usr/share/doc/fontconfig/fontconfig-user.html. AUTHOR
This manual page was written by Keith Packard <keithp@keithp.com> and Josselin Mouette <joss@debian.org>. 05 May 2008 FC-CACHE(1)
All times are GMT -4. The time now is 11:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy