I created a script,
Code:
size=`du -sm`
size=`echo $size | sed 's/.$//'`
size1='30720'
if [ $size -gt $size1 ]
then
{
find /ask/tarballs -type f -name "*.tgz" -mtime +30 -exec ls -l {} \;
find /ask/tarballs -type f -name "*.tgz" -mtime +30 -exec rm -f {} \;
}
else
echo "Directory size doesnt exceed Threshold Limit"
fi
==============
which is in th
Hi everyone, i'd like someone chechk this script, i know it's very simple but it doesn't work good, let me tell you this script works over huge directories, maybe that's the problem, if somebody can give me other way to develop, or show me where it's the problem, i'll appreciate it.
Code:
PATH_ROOT="/ot/bean/923/domains/scape"
find $PATH_ROOT/servers/scape-admin/logs/*.log* -mtime
i feel weird with this 2 command
Code:
find /tmp/*test* -user `whoami` -mtime +1 -type f -exec rm -f {}\;
find /tmp/*test* -user `whoami` -mtime +1 -type f -exec ls -lrt {}\;
the first one return correct which only delete those filename that consist *test* where second command it listed all the files inside the directory which including those filename that not *test*
can someone help to ex
Hi,
I'm trying to find all files that have a .ksh and .p extension and that are 7 days old by using the below find command but it doesn't seem to as expected. It gives me random results.. Can someone point out what may be wrong?
Code:
find . -name "*.ksh" -o -name "*.p" -mtime -7
Hi,
I need to delete the last N days file using find.
I am trying to use
find . -mtime -10 -print
which lists down required files.
but when i use
find . -mtime -10 -exec ls -lrt {} \;
it gives me all files in the directory including the required files but the required files are having ./ preceded with them.
Now when I tried
find .
i want to remove *.req files from directory
/opt/FFCL8001/oracle/inst/apps/FFCL8001_lhrho/logs/appl/conc/log
i executed command find . -name '*.req' -mtime +2 -exec rm {} \;
but it is running since hours and free space in /opt is same as old 7.4 GB .
why it is not removing files ?
Hi all,
1). Is is possible to use the date builtin and subtract a literal e.g 1 day in bash alongwith the find command from the command line:
e.g
Code:
find . -name --date %Y-%m-%d - 1
2).
Hi,
I have two scripts that remove files. One works fine and is coded
Code:
find -name "syst*" -mtime +1 -exec rm {} \;
The other is almost the same - only thing missing is the '\'.
Hi ,
I am adding a line in my shell scripts to delete all the old directory with the below command. On running this command it is coming out with the message
find: incomplete statement
Code:
find /ersdg3/ERS/ERS_INPUT_LOGS/RIO/rio_archive -type d -mtime +47 -exec rm -rf {}
What is wrong or missing in it.
My os sun solaris 10
Guddu