Files.... undeletable.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Files.... undeletable.
# 1  
Old 10-04-2011
Files.... undeletable.

I've some files created by a script.
For some reason last time the script run was interrupted for an error and the files produced by the script are undeletable.


i've tryed as root with command 'rm' and even if i got no error in command execution the files are still there.
These are the files:
Code:
-rw-r--r--  1 nsm  4544256 Oct  4 13:32 20111003-Bologna.txt
-rw-r--r--  1 nsm  5974396 Oct  4 12:17 20111003-Firenze.txt
-rw-r--r--  1 nsm 24401362 Oct  4 13:32 20111003-FW6.txt
-rw-r--r--  1 nsm 18478087 Oct  4 13:05 20111003-Genova.txt
-rw-r--r--  1 nsm  9787330 Oct  4 12:31 20111003-Napoli.txt
-rw-r--r--  1 nsm  5133364 Oct  4 12:14 20111003-Palermo.txt
-rw-r--r--  1 nsm 26527517 Oct  4 13:32 20111003-Verona.txt

The folder where they resides is not a particular folder as the path is tmp/folderSmilie

The system is a FreeBSD.

Last edited by Scott; 10-04-2011 at 10:08 AM.. Reason: Please use code tags
# 2  
Old 10-04-2011
Initially try with rm -f filename.txt If not satisfied then try like this ..
Code:
$ find /tmp/folder -name "*.txt" -type f -exec rm -f {} \;

# 3  
Old 10-04-2011
Hi, tnX for answer.
I've tried also rm -f without success but...

renaming the file and then deleting it works. I ignore the reason...

---------- Post updated at 03:20 PM ---------- Previous update was at 03:16 PM ----------

Sorry. Works with max part of files.
There are still 2 files i cannot rename.

---------- Post updated at 03:21 PM ---------- Previous update was at 03:20 PM ----------

Quote:
Originally Posted by jayan_jay
Code:
$ find /tmp/folder -name "*.txt" -type f -exec rm -f {} \;


Is this a script or a command i need to execute manually?

---------- Post updated at 03:39 PM ---------- Previous update was at 03:21 PM ----------

Update.

I've removed the last 2 files by renaming the folder that contain them and after i was able to simply 'rm' the 2 files...
Very strange. I cannot give an explanation to this.Smilie

---------- Post updated at 04:09 PM ---------- Previous update was at 03:39 PM ----------

ooops. The problem still persit: if i recreate a folder with the same name the files magically appear again in the folders.
# 4  
Old 10-04-2011
We appreciate the updates (really!), but perhaps you should run a fsck on the filesystem.

What type of filesystem is it?
# 5  
Old 10-04-2011
I also was thinking that something got corrupted...

But its a freebsd where runs a juniper system (NSM) i'm not sure about what kind of check disk use...
# 6  
Old 10-04-2011
If there's something odd about the pathnames involved, it's very possible that it will not show up when you copy/paste a simple ls listing.

If you'd like to improve the quality of assistance, at the very least provide the results of piping ls or find through hexdump -C.

And to be thorough, it would not be a bad idea to post the script that's generating these "undeletable" files, the parameters used to mount the filesystem on which the files reside, and any information regarding flags and acls in effect for the pathnames in question.

Regards and good luck,
Alister
# 7  
Old 10-07-2011
Quote:
Originally Posted by Scott
We appreciate the updates (really!), but perhaps you should run a fsck on the filesystem.

What type of filesystem is it?
I've tryed with command fsck but i got this warning:
Code:
[root@NsmTest2010 /]# fsck
fsck 1.35 (28-Feb-2004)
e2fsck 1.35 (28-Feb-2004)
/dev/VolGroup00/LogVol00 is mounted.

WARNING!!!  Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.

Do you really want to continue (y/n)?

I think i have to unmount the volum before run the fsck but i'm not sure how... and if is a dangerous operation.

This is the df -T output:
Code:
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/sda2     ext3     5036316    145388   4635096   4% /
none         tmpfs     2076104         0   2076104   0% /dev/shm
/dev/sda10    ext3     4032092   2018272   1808996  53% /tmp
/dev/sda8     ext3    20161172   6610124  12526908  35% /usr
/dev/sda6     ext3    85088380  35741324  45024772  45% /var
/dev/sda5     ext3    50394964     86084  47748924   1% /var/cores
/dev/sdb2     ext2   235271996 183597636  39723208  83% /var/netscreen/DevSvr
/dev/sda3     ext2    50394996    518616  47316424   2% /var/netscreen/DevSvr/profiler_data
/dev/sda7     ext3    20161172   5453656  13683376  29% /var/netscreen/GuiSvr

Is possible to check only the /tmp folder?

Moderator's Comments:
Mod Comment Please use code tags. A tutorial, just for you Smilie

Last edited by Scott; 10-07-2011 at 01:02 PM.. Reason: Code tags
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. OS X (Apple)

Undeletable file

Greetings, I'm trying to delete a file with a weird name from within Terminal on a Mac. It's a very old file (1992) with null characters in the name: “␀␀Word FinderÂŽ Plus™”. Here are some examples of what I've tried: 12FX009:5 dpontius$ ls ␀␀Word FinderÂŽ Plus™ 12FX009:5 dpontius$ rm... (29 Replies)
Discussion started by: dpontius
29 Replies

2. UNIX for Beginners Questions & Answers

Automate splitting of files , scp files as each split completes and combine files on target server

i use the split command to split a one terabyte backup file into 10 chunks of 100 GB each. The files are split one after the other. While the files is being split, I will like to scp the files one after the other as soon as the previous one completes, from server A to Server B. Then on server B ,... (2 Replies)
Discussion started by: malaika
2 Replies

3. Shell Programming and Scripting

Shell script for field wise record count for different Files .csv files

Hi, Very good wishes to all! Please help to provide the shell script for generating the record counts in filed wise from the .csv file My question: Source file: Field1 Field2 Field3 abc 12f sLm 1234 hjd 12d Hyd 34 Chn My target file should generate the .csv file with the... (14 Replies)
Discussion started by: Kirands
14 Replies

4. Shell Programming and Scripting

How to create zip/gz/tar files for if the files are older than particular days in UNIX or Linux?

I need a script file for backup (zip or tar or gz) of old log files in our unix server (causing the space problem). Could you please help me to create the zip or gz files for each log files in current directory and sub-directories also? I found one command which is to create gz file for the... (4 Replies)
Discussion started by: Mallikgm
4 Replies

5. Shell Programming and Scripting

need a shell script to extract the files from source file and check whether those files existonserve

Hi, I am new to shell scripting.Please help me on this.I am using solaris 10 OS and shell i am using is # echo $0 -sh My requirement is i have source file say makefile.I need to extract files with extensions (.c |.cxx |.h |.hxx |.sc) from the makefile.after doing so i need to check whether... (13 Replies)
Discussion started by: muraliinfy04
13 Replies

6. UNIX for Dummies Questions & Answers

write a program in c in unix that display the files(includ sub-direc and files within) in a sorted

the sorting is based on name of file, file size modification time stamps o f file it should dislay the output in the following format "." and ".." enteries should be ignored please give some idea how to do it (1 Reply)
Discussion started by: pappu kumar jha
1 Replies

7. Shell Programming and Scripting

How to extract data from indexed files (ISAM files) maintained in an unix server.

Hi, Could someone please assist on a quick way of How to extract data from indexed files (ISAM files) maintained in an UNIX(AIX) server.The file data needs to be extracted in flat text file or CSV or excel format . Usually we have programs in microfocus COBOL to extract data, but would like... (2 Replies)
Discussion started by: devina
2 Replies

8. Shell Programming and Scripting

How to retrieve all the linked script files/ctl files/sql files?

Hi I am going to migrate our datawarehouse system from HP Tru 64 Unix to the Red Hat Linux. Inside the box, it is running around 40 cron jobs; inside each cron job, it is calling other shell script files, and the shell script files may again call other shell script files or ctl files(for... (1 Reply)
Discussion started by: franksubramania
1 Replies

9. UNIX for Dummies Questions & Answers

undeletable file

when i try to ls -lrt the directory, the "undeletable" file is listed. but when i try to ls -lrt *exe, the "undeletable" file is not listed. this "undeletable" is the file that i want to delete from the directory. but when i try to delete/rename/copy.... it, it show that "No such file or... (10 Replies)
Discussion started by: chxxangie
10 Replies
Login or Register to Ask a Question