LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Suse/Novell (http://www.linuxquestions.org/questions/suse-novell-60/)
-   -   clean-tmp - cron task suse 10.3 (http://www.linuxquestions.org/questions/suse-novell-60/clean-tmp-cron-task-suse-10-3-a-589959/)

flebber 10-06-2007 08:00 PM

clean-tmp - cron task suse 10.3
 
Can't get this cron script to work I cannot follow the suse-doc well enough to know how to manually write the crontab entry for this so tried kcron and vcron but neither on reboot cleans /tmp and they don't seem to write an entry into /etc/crontab either.

How can I get it working
Hopefully its just to early in the morning here and thats why docs not making sense
Code:

9.1.2. The cron Package

The cron tables are now located in /var/cron/tabs. /etc/crontab serves as a system-wide cron table. Enter the name of the user who should run the command directly after the time table. In Example 9.1. “Example of an Entry in /etc/crontab”, root is entered. Package-specific tables, located in /etc/cron.d, have the same format. See man cron.

Example 9.1. Example of an Entry in /etc/crontab

1-59/5 * * * * root test -x /usr/sbin/atrun && /usr/sbin/atrun

/etc/crontab cannot be processed with crontab -e. It must be loaded directly into an editor, modified, then saved.

A number of packages install shell scripts to the directories /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly, whose instructions are controlled by /usr/lib/cron/run-crons. /usr/lib/cron/run-crons is run every fifteen minutes from the main table (/etc/crontab). This guarantees that processes that may have been neglected can be run at the proper time.

The daily system maintenance jobs have been distributed to various scripts for reasons of clarity. They are contained in the package aaa_base. /etc/cron.daily contains, for instance, the components backup-rpmdb, clean-tmp, or clean-vi.


rtspitz 10-06-2007 08:09 PM

/etc/sysconfig/cron:

## Type: string
## Default: no
#
# "Set this to "yes" to entirely remove (rm -rf) all files and subdirectories
# from the temporary directories defined in TMP_DIRS_TO_CLEAR on bootup.
# Please note, that this feature ignores OWNER_TO_KEEP_IN_TMP - all files will
# be removed without exception."
#
# If this is set to a list of directories (i.e. starts with a "/"), these
# directories will be cleared instead of those listed in TMP_DIRS_TO_CLEAR.
# This can be used to clear directories at boot as well as clearing unused
# files out of other directories.
#
CLEAR_TMP_DIRS_AT_BOOTUP="yes"

flebber 10-07-2007 01:02 AM

Thanks that worked perfect.


All times are GMT -5. The time now is 02:03 PM.