Jump to content

unix vallantha okasari itu randi


Recommended Posts

Posted

[quote author=celebrate link=topic=168755.msg2042602#msg2042602 date=1300335969]
nope touch command ledhu.,

@ PMREDDY: Hey actually these are huge files so manual ga cheyalekapothunnanu but something time stamp tho rasthunnanu script...
[/quote]
huge files but number of files???

  • Replies 47
  • Created
  • Last Reply

Top Posters In This Topic

  • PMREDDY19

    14

  • gunnerz4ever

    13

  • celebrate

    12

  • Gachibowli_Diwakar

    4

Top Posters In This Topic

Posted

if mtime +1 removes for 1 day.. why dont you give a try with mtime +1/12

its just a simple math kadha mama

Posted

try this one
LOG_FILE=`find /home/Logdir -name "*.log" -mtime +1 -exec ls -lrt {} \; | awk '{print $9}'`
for FILE in LOG_FILE
do
rm ${FILE}
done

Posted

[quote author=PMREDDY19 link=topic=168755.msg2042631#msg2042631 date=1300336222]
huge files but number of files???
[/quote]

Space is fine but the logs are more than 500 hourly, actually ivi incoming logs for which  current logs processing kosam need to rm files....

Posted

[quote author=PMREDDY19 link=topic=168755.msg2042598#msg2042598 date=1300335920]
looks like mtime is using the number of days dude...


we may need to use the number of days only ..
so lets check if

find . -mtime +0.25 -exec rm -r { } \ ;

try chesi chuddali if possible..
on some test folder..
[/quote]



not accepting +0.25

Posted

[quote author=gunnerz4ever link=topic=168755.msg2042677#msg2042677 date=1300336669]
try this one
LOG_FILE=`find /home/Logdir -name "*.log" [b][size=12pt][color=red]-mtime +1[/color][/size][/b] -exec ls -lrt {} \; | awk '{print $9}'`
for FILE in LOG_FILE
do
rm ${FILE}
done
[/quote]that deletes the files which are 1day older

Posted

[quote author=celebrate link=topic=168755.msg2042681#msg2042681 date=1300336696]
Space is fine but the logs are more than 500 hourly, actually ivi incoming logs for which  current logs processing kosam need to rm files....
[/quote]

meeku logs rotation ki emi script ledha in place like whenever u run the script all the old logs move to a different folder after compressed  kindoff../


Posted

this is for for every 2 hrs
find . -name "*.log[0-9]*" -o -name "*.log" -mtime +3 |xargs rm -fR {} \;

Posted

[quote author=gunnerz4ever link=topic=168755.msg2042694#msg2042694 date=1300336821]
this is for for every 2 hrs
find . -name "*.log[0-9]*" -o -name "*.log" -mtime +3 |xargs rm -fR {} \;
[/quote]mtime ante machine time kadha mama .. so that script deletes files which are older than 3days

he needs to use mmin instead of mtime I guess

Posted

find /tmp/ -type f -mmin 30 -exec rm {} \;

this is for 30 mins ago

Posted

find /tmp/ -type f -mmin 30 -exec rm {} \;

to remove files that have been modified from 30 minutes ago.

mtime remove files n*24 hours old, mmin n minutes old (where n is the number that you pass after the parameter mmin or mtime)

Posted

@PMReddy you are correct decimals thesukovatledhu....

@gunnerz4ever & Musugu_Veerudu : solarils lo find: bad option -mmin anni vasthundi....






Posted

or else try this one
find $HOME/Log -type f -name "*.log" -amin +30 -exec ls {} \;

Posted

[quote author=celebrate link=topic=168755.msg2042762#msg2042762 date=1300337457]
@PMReddy you are correct decimals thesukovatledhu....

@gunnerz4ever & Musugu_Veerudu : solarils lo find: bad option -mmin anni vasthundi....
[/quote]looks like you have to touch a file with date in it..and then call your script to delete the files older than date in it..

man mtime .. or .. man mmin ani type cheyi.. if it says No manual.. it means those will not work

Posted

[quote author=celebrate link=topic=168755.msg2042762#msg2042762 date=1300337457]
@PMReddy you are correct decimals thesukovatledhu....

@gunnerz4ever & Musugu_Veerudu : solarils lo find: bad option -mmin anni vasthundi....
[/quote]

dude u should have told it before as it is a solaris box,question clarity ga unte fast ga answer ochedhi kada ,but let me try.

×
×
  • Create New...