Unable to list files in a directory


 
Thread Tools Search this Thread
Operating Systems Solaris Unable to list files in a directory
# 8  
Old 04-01-2015
my script does not seem to be working, because the number of files continues the same, but, I found that when running:
Code:
 df -F ufs -o i /opt/optima
Filesystem             iused   ifree  %iused  Mounted on
/dev/dsk/c0t0d0s4   10000493  500179    95%   /opt/optima

and

Code:
 df -h /opt/optima
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0t0d0s4       83G    47G    35G    58%    /opt/optima

so clearly there is a problem here, please how can I go about delete this files, please help

---------- Post updated at 04:53 PM ---------- Previous update was at 02:38 PM ----------

Please, help... my script does not seem to be working...:
Code:
touch -mt 201501010000 /var/tmp/ref3
touch -mt 201503312359 /var/tmp/ref4
find /opt/optima/Interfaces/ERICSSON/ALL/ASN/12/parser/out/UNKNOWN -type f \( -newer /var/tmp/ref3 -a ! -newer /var/tmp/ref4 \) -ls -exec rm -f {} +

and:
Code:
df -F ufs -o i /opt/optima
Filesystem             iused   ifree  %iused  Mounted on
/dev/dsk/c0t0d0s4   10004339  496333    95%   /opt/optima

Any alternatives to this?
# 9  
Old 04-01-2015
It works here. If it doesn't work for you, something's either wrong with your reference files, or your files themselves not matching the date range you think they ought.

Check your reference files, and also check that the files you want to delete are in the date range you want.

You can do that with find -ls as suggested by others already.
# 10  
Old 04-01-2015
I have used the
Code:
find . ls

code to list the files, so it was showing files, so I did a
Code:
ls -lrt

of one files shown, and I could see the timestamp of Feb, hence my script that with includes all files from the month of february.
I beleive the problem lies because, as my script is deleting other systems are ftp files to that particular directory
# 11  
Old 04-01-2015
Do you know what ls -lrt means?

-r: sort reverse
-t: sort by time

So you are sorting a list of one file backwards by time...

find . -ls should show dates, too, it does here, what does it show for you?
# 12  
Old 04-01-2015
I get the impression that the repeated
Code:
df -F ufs -o i /opt/optima

shows that your ifree still shrinks (and iused still raises).
If that's the case then there could be a run-away process that is non-stop creating new files.
Here comes a method to find such a run-away process.
Search for all files created within the last 24 hours:
Code:
find /opt/optima -type f -mtime -1 -ls

Are there very many similar files with a common owner (column 5)?
List the most busy processes (top 20):
Code:
prstat 0 1 | head -20

Is there a process with the same owner (column 2)?
# 13  
Old 04-01-2015
I beleive all the files have the same owner:
Code:
 find . -type f -mtime -1 -ls
9996072    1 -rw-r--r--   1 optima   sys           492 Apr  1 15:41 ./C20150401_1300_20150401_1400_MSC4_OPTIMA3_201504011300_2830_8_UNKNOWN_NCELHNDTOT__20150401162227332.csv
9990184    1 -rw-r--r--   1 optima   sys           446 Apr  1 11:32 ./C20150401_0900_20150401_1000_MSC4_OPTIMA2_201504010900_2826_tmp_10_UNKNOWN_SYS7IND__20150401113207285.csv
9993583    1 -rw-r--r--   1 optima   sys           453 Apr  1 14:15 ./C20150401_1200_20150401_1300_MSC4_OPTIMA2_201504011200_2829_3_UNKNOWN_SYS7IND__20150401151923600.csv
9993598    1 -rw-r--r--   1 optima   sys           453 Apr  1 14:15 ./C20150401_1200_20150401_1300_MSC4_OPTIMA2_201504011200_2829_8_UNKNOWN_SYS7IND__20150401152011337.csv

and the most busiest processes are not owned by sys:

Code:
 prstat 0 1 | head -20
   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP
 23415 root     2448K  672K cpu16   60    0   5:44:06 2.9% find/1
 29187 root     1616K 1512K cpu28   60    0   0:01:32 2.9% find/1
 29188 root     3360K 3256K cpu1    49    0   0:00:00 0.0% prstat/1
  1380 noaccess  226M  119M sleep   59    0   0:03:59 0.0% java/55
   384 root       11M 3976K sleep   59    0   0:00:00 0.0% smbd/1
   453 root     2096K   32K sleep   59    0   0:00:00 0.0% smcboot/1
   408 daemon   2464K   32K sleep   60  -20   0:00:00 0.0% lockd/2
   456 root     2576K  584K sleep   59    0   0:00:00 0.0% ttymon/1
   455 root     2096K   32K sleep   59    0   0:00:00 0.0% smcboot/1
   390 daemon   2872K   56K sleep   59    0   0:00:00 0.0% rpcbind/1
   154 root     2256K   16K sleep   59    0   0:00:00 0.0% drd/2
 29143 optima   1400K 1352K sleep   53    2   0:00:00 0.0% sh/1
   202 root     1448K    8K sleep   59    0   0:00:00 0.0% efdaemon/1
   114 root     2648K   32K sleep   59    0   0:00:00 0.0% syseventd/14
   380 root       11M 5296K sleep   59    0   0:00:00 0.0% smbd/1
Total: 299 processes, 525 lwps, load averages: 1.87, 1.34, 1.17

I beleive some other machine or source is sending files to that directory all the time. But I do not have the means to stop this

---------- Post updated at 09:36 PM ---------- Previous update was at 09:33 PM ----------

Code:
 find . -ls
 6862 992872 drwxr-xr-x   2 optima   sys      1016185856 Apr  1 21:06 .
9996072    1 -rw-r--r--   1 optima   sys           492 Apr  1 15:41 ./C20150401_1300_20150401_1400_MSC4_OPTIMA3_201504011300_2830_8_UNKNOWN_NCELHNDTOT__20150401162227332.csv
9990184    1 -rw-r--r--   1 optima   sys           446 Apr  1 11:32 ./C20150401_0900_20150401_1000_MSC4_OPTIMA2_201504010900_2826_tmp_10_UNKNOWN_SYS7IND__20150401113207285.csv
675490    1 -rw-r--r--   1 optima   sys           630 Feb 11 21:33 ./C20150211_1100_20150211_1200_HLR1_OPTIMA2_201502111100_945_36_UNKNOWN_ID1__20150211214840896.csv
861214    1 -rw-r--r--   1 optima   sys           824 Feb 11 21:33 ./C20150211_1100_20150211_1200_HLR1_OPTIMA2_201502111100_945_37_UNKNOWN_NBSFRV1PTOT__20150211214849663.csv
611404    1 -rw-r--r--   1 optima   sys           824 Feb 11 21:33 ./C20150211_1100_20150211_1200_HLR1_OPTIMA2_201502111100_945_38_UNKNOWN_NBSFRV1PTOT__20150211214858517.csv
480538    1 -rw-r--r--   1 optima   sys           824 Feb 11 21:33 ./C20150211_1100_20150211_1200_HLR1_OPTIMA2_201502111100_945_39_UNKNOWN_NBSFRV1PTOT__20150211214907389.csv
715105    1 -rw-r--r--   1 optima   sys           443 Feb 11 21:29 ./C20150211_1100_20150211_1200_HLR1_OPTIMA2_201502111100_945_3_UNKNOWN_SYS7IND__20150211214916296.csv
89334    1 -rw-r--r--   1 optima   sys           824 Feb 11 21:33 ./C20150211_1100_20150211_1200_HLR1_OPTIMA2_201502111100_945_40_UNKNOWN_NBSFRV1PTOT__20150211214925196.csv
79527    1 -rw-r--r--   1 optima   sys           521 Feb 11 21:33 ./C20150211_1100_20150211_1200_HLR1_OPTIMA2_201502111100_945_41_UNKNOWN_NISDNCALL__20150211214934043.csv
89481    1 -rw-r--r--   1 optima   sys           521 Feb 11 21:33 ./C20150211_1100_20150211_1200_HLR1_OPTIMA2_201502111100_945_42_UNKNOWN_NISDNCALL__20150211215323905.csv
611339    1 -rw-r--r--   1 optima   sys           521 Feb 11 21:33 ./C20150211_1100_20150211_1200_HLR1_OPTIMA2_201502111100_945_43_UNKNOWN_NISDNCALL__20150211215332823.csv

# 14  
Old 04-01-2015
The owner is optima (not sys).
So the only candidate on your system is pid 29143
Code:
ptree 29143

shows the relevant process tree.
If this is NFS-exported then it could be sent from another system.
Code:
showmount

might show the NFS clients.
Or - I see smbd - CIFS-shared.
Code:
smbstatus

might show the CIFS clients.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unable to ssh and list files in local directory from remote.

#!/bin/bash script_work_dir="/home/websys/TEST_dpi_42_file_trnsfer_engine/PORT22/script_work_area" script_config_dir="/home/websys/TEST_dpi_42_file_trnsfer_engine/PORT22/script_config" dpi_sourceServerList=$script_config_dir"/dpi_sourceServerList" dpi_srvr_42="rtm@1.1.1.1"... (8 Replies)
Discussion started by: sadique.manzar
8 Replies

2. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

3. UNIX for Dummies Questions & Answers

Unable to find files, those can be present anywhere in the directory tree,based on its creation date

Hi I am unable to find files, those are present anywhere in the same directory tree, based on the creation date. I need to find the files with their path, as I need to create them in another location and move them. I need some help with a script that may do the job. Please help (2 Replies)
Discussion started by: sam192837465
2 Replies

4. Shell Programming and Scripting

Unable to list files in ascending order

Hi ! I am just trying to list my files in ascending order so that in some other software, I just want merge with some modification, when I list its coming like this new-10.txt new-11.txt new-12.txt new-13.txt new-14.txt new-15.txt new-16.txt new-17.txt new-18.txt new-19.txt... (2 Replies)
Discussion started by: nex_asp
2 Replies

5. Red Hat

Unable to copy files due to many files in directory

I have directory that has some billion file inside , i tried copy some files for specific date but it's always did not respond for long time and did not give any result.. i tried everything with find command and also with xargs.. even this command find . -mtime -2 -print | xargs ls -d did not... (2 Replies)
Discussion started by: before4
2 Replies

6. Shell Programming and Scripting

Copy list of files from a keyword list to another directory

Hello, I have a folder with a massive amount of files, and I want to copy out a specific subset of the files to a new directory. I would like to use a text file with the filenames listed, but can't get it to work. The thing I'm hung up on is that the folder names in the path can and do have... (5 Replies)
Discussion started by: twjolson
5 Replies

7. Shell Programming and Scripting

find list of files from a list and copy to a directory

I will be very grateful if someone can help me with bash shell script that does the following: I have a list of filenames: A01_155716 A05_155780 A07_155812 A09_155844 A11_155876 that are kept in different sub directories within my current directory. I want to find these files and copy... (3 Replies)
Discussion started by: manishabh
3 Replies

8. UNIX for Dummies Questions & Answers

unable to list the files

Hi, $ ls -ltr *.log Error : argument list too long: ls How to rectify this ? (2 Replies)
Discussion started by: risshanth
2 Replies

9. UNIX for Dummies Questions & Answers

Unable to view files in a particular directory under /opt

Hi Everybody, I am Unable to view files in a particular directory under /opt. But, when I reboot the server, I am able to view the files.. Its happening daily. Do u 've n e answers/suggestions. Kindly help.. :eek: (1 Reply)
Discussion started by: its.simron
1 Replies

10. Linux

Unable to view files in a particular directory under /opt

Hi Everybody, I am Unable to view files in a particular directory under /opt. But, when I reboot the server, I am able to view the files.. Its happening daily. Do u 've n e answers/suggestions. Kindly help.. :confused: (1 Reply)
Discussion started by: its.simron
1 Replies
Login or Register to Ask a Question