Re: tmpwatch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Frank Murphy <frankly3d <at> gmail.com> writes:

> 
> What is the norma setting for tmpwatch in Fedora,
> couldn't find tmpwatch.conf,
> tmpwatch --help
> 
> cheked cron.daily:
> not knowing script too well.
> 
> It seem sto be set to clean every 30 days?
> How can I change it to every day,
> where something hasn't been used\touched for a day\24hr?
>   where an update won't overwrite changes.
> 
> Why are the *-unix excluded.
> 
> #! /bin/sh
> 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 \
> 	-X '/tmp/hsperfdata_*' 10d /tmp
> /usr/sbin/tmpwatch "$flags" 30d /var/tmp
> for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do
>      if [ -d "$d" ]; then
> 	/usr/sbin/tmpwatch "$flags" -f 30d "$d"
>      fi
> done
> 

man tmpwatch

The flags=-umc is explained in man page
...
      If the --atime, --ctime or --mtime options are used in combination
...

The *-unix are excluded because they are e.g. X related (UNIX sockets)
$ netstat -a | grep -i .X11-unix
$ ls -al /tmp/
$ ls -al /tmp/.X11-unix/

I you want to run your own tmpwatch cron job with your changes:
- create your version of /etc/cron.daily/tmpwatch somwhere that will not
  be overwritten (e.g. your home dir $HOME/cron.daily/tmpwatch)
  e.g.
  change to 1d instead of 30d where appropriate according to tmpwatch format.
- add or create or modify a crontab file for a user to be run by cron
  cron(1), crontab(1)
  # ls -l /var/spool/cron
  # crontab -u jb -e
  < edit it by adding a job; see examples in crontab(5), e.g.
    SHELL=/bin/sh
    MAILTO=root
    # run five minutes after midnight, every day
    5 0 * * *       $HOME/cron.daily/tmpwatch

JB


-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux