LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   file in /tmp is lost (http://www.linuxquestions.org/questions/linux-general-1/file-in-tmp-is-lost-296946/)

ust 03-02-2005 08:18 PM

file in /tmp is lost
 
I found that the file in /tmp is lost and I also found that there is below crontab job , I think the reason the file is lost is because the below cron job , could suggest how can I disable it ? thx.

#vi /etc/crontab

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

#/etc/cron.daily> vi tmpwatch
/usr/sbin/tmpwatch 240 /tmp
/usr/sbin/tmpwatch 7200 /var/tmp
for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do
if [ -d "$d" ]; then
/usr/sbin/tmpwatch -f 720 $d
fi
done

btmiller 03-02-2005 08:23 PM

Simply remove the tmpwatch file from /etc/cron.daily to disable tmpwatch from running daily. But you really shouldn't be using /tmp for permanent long term storage anyhow.

jtshaw 03-02-2005 08:25 PM

You shouldn't be storing files in /tmp. Many setups will blow away everything in there on boot, shutdown, or both. To disable a cron job just take the executable privileges from the file. "chmod a-x <script>"

ust 03-02-2005 08:52 PM

thx reply ,

i tried to change "/usr/sbin/tmpwatch 240 /tmp" to "/usr/sbin/tmpwatch 9999 /tmp" , but the file seems still lost , could suggest how to change the schedule to delete the file eg. once for 2 months ? thx


All times are GMT -5. The time now is 11:34 PM.