LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-09-2011, 03:03 AM   #1
Soji Antony
Member
 
Registered: Jul 2010
Posts: 54

Rep: Reputation: 1
/etc/cron.daily/tmpwatch script


Can anybody help me to understand the following tmpwatch script...

Code:
flags=-umc
/usr/sbin/tmpwatch "$flags" -x /tmp/.X11-unix -x /tmp/.XIM-unix \
-x /tmp/.font-unix -x /tmp/.ICE-unix -x /tmp/.Test-unix 240 /tmp
/usr/sbin/tmpwatch "$flags" 720 /var/tmp
for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do
if [ -d "$d" ]; then
/usr/sbin/tmpwatch "$flags" -f 720 "$d"
fi
done
While googling for tmpwatch I found that by default this script will be executed daily and will remove tmp files older than 10 days ... But i can see two <hour> options 240 ( 10 days) & 720 (30 days) in this script... So where can I edit/change so that default ( 10 days ) can be changed to something else ??

Also what does "-x" option do ?
 
Old 02-09-2011, 11:51 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Why don't you change 240 for something else ?

-x is an entry to be excluded from the clean up operation.
man tmpwatch
 
1 members found this post helpful.
Old 02-10-2011, 03:55 AM   #3
Soji Antony
Member
 
Registered: Jul 2010
Posts: 54

Original Poster
Rep: Reputation: 1
Thanks a lot ...
 
Old 04-14-2011, 02:17 AM   #4
Cybertron13
LQ Newbie
 
Registered: Apr 2011
Posts: 1

Rep: Reputation: 0
for d in /tmp/aaa /tmp/bkk /tmp/bbb /tmp/ccc; do
if [ -d "$d" ]; then
/usr/bin/tmpwatch -f 720 "$d"
fi
done



would this remove the folders aaa bbb and ccc or their content?
 
Old 04-15-2011, 06:05 AM   #5
Soji Antony
Member
 
Registered: Jul 2010
Posts: 54

Original Poster
Rep: Reputation: 1
Hi

It will remove directory contents, not the directory.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
script not executed by cron.daily hopefull Linux - Newbie 6 01-17-2009 09:54 AM
/etc/cron.daily/find script sulekha Ubuntu 1 11-09-2008 03:06 AM
Script not being run in cron.daily hazmatt20 Linux - General 10 10-12-2008 08:24 PM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
Problem With Script in cron.daily fizbang Linux - Newbie 10 03-21-2005 10:23 AM


All times are GMT -5. The time now is 01:37 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration