Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


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

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

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

/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"
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-10-2011, 12:51 AM   #2
Senior Member
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
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, 04:55 AM   #3
Soji Antony
Registered: Jul 2010
Posts: 54

Original Poster
Rep: Reputation: 1
Thanks a lot ...
Old 04-14-2011, 03:17 AM   #4
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"

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

Original Poster
Rep: Reputation: 1

It will remove directory contents, not the directory.


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 10:54 AM
/etc/cron.daily/find script sulekha Ubuntu 1 11-09-2008 04:06 AM
Script not being run in cron.daily hazmatt20 Linux - General 10 10-12-2008 09:24 PM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 09:16 AM
Problem With Script in cron.daily fizbang Linux - Newbie 10 03-21-2005 11:23 AM

All times are GMT -5. The time now is 07:22 PM.

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