Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-27-2005, 02:54 AM
|
#1
|
|
LQ Newbie
Registered: Nov 2004
Posts: 26
Rep:
|
getting files deleted on /tmp
I need very usually to download files fom internet on /tmp.
I launch the download every night, I see the files being downloaded.
The following day I get the files deleted.
any idea?
|
|
|
|
01-27-2005, 03:18 AM
|
#2
|
|
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109
Rep:
|
I don't know what distro you're running, but on RedHat style systems, there's a cron job which deletes files from /tmp which are older than a certain number of hours.
On my system (Fedora C.3) the number of hours is 240, but it could be different on yours. Have a look in /etc/cron.daily for something like tmpwatch, and have a look inside.
If you can't find /etc/cron.daily, then try to find out more about cron on your distro.
Dave
|
|
|
|
01-27-2005, 03:20 AM
|
#3
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Some distro's have an option to delete the files when rebooting, so that the /tmp directory doesn't get to full. Use a directory in your home directory to download files. Another option is to use /var/tmp for the downloading of files. The /tmp partition is really just for the system and tends to be smaller than the /var partition.
I don't know where you would change it. I don't even know which distro you have, but one of the scripts that runs during shutdown, or maybe even a cron script is probably what is doing it.
For mandrake, the graphical setting is in the BOOT setup. You might also browse through the files in /etc/sysconfig/. Sometimes settings are based there.
|
|
|
|
01-27-2005, 03:41 AM
|
#4
|
|
LQ Newbie
Registered: Nov 2004
Posts: 26
Original Poster
Rep:
|
Dave, I looked in /etc/cron.daily and that's its content:
/usr/sbin/tmpwatch 240 /tmp
/usr/sbin/tmpwatch 720 /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
which meens that files are deleted after 240 hours. In my case , I started download the files yesterday (~ 16h ) and this morning I got them deleted (very fewer than 240 hours).
jschiwal, this pb occures even if I don't rebbot my system.
|
|
|
|
01-27-2005, 03:53 AM
|
#5
|
|
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109
Rep:
|
Hmmm.
1) Is there enough space on /tmp to let the download finish?
2) It's possible (but very unlikely) that the program you're using to download is removing any temp files it's created in /tmp when it exits, and is accidentally removing the downloaded file as well.
Apart from that, I'm not sure.
Dave
|
|
|
|
01-27-2005, 04:06 AM
|
#6
|
|
LQ Newbie
Registered: Nov 2004
Posts: 26
Original Poster
Rep:
|
Yes dave, I hve about 4 GB free on my /tmp and files I need to download do not exceed 1.5GB.
I use the wget tool for downloading my files.
What I have noticed, is that files that have been downloaded and yet used (even by a simple read) are not delated. But files that I left during remote downloading are deleted.
I dont't have enough space disk on my home, that's why I need to download these files on /tmp.
I work on a shared machine and don't have root rights to get more space on my home.
|
|
|
|
01-27-2005, 04:16 AM
|
#7
|
|
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109
Rep:
|
The administrator is probably running a cron job to remove files from /tmp on a regular basis.
If files which get read don't get deleted, then try running 'touch /tmp/downloadedfile' after wget finishes, then it will look like the file has been read.
I seem to remember a bug in wget a while ago which did strange things when downloading large files. If you've got an old version of wget, it could be that.
Dave
|
|
|
|
01-27-2005, 04:33 AM
|
#8
|
|
LQ Newbie
Registered: Nov 2004
Posts: 26
Original Poster
Rep:
|
The problem arieses when I'm not in my office (by night when I usually launch my downloads) so the touch command could not really solve mu pb. Perhaps soud I put on a script that executes the wget command and executes the touch command after the download is completed.
I'm using the 1.8.1 wget version.
|
|
|
|
01-27-2005, 04:51 AM
|
#9
|
|
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109
Rep:
|
I don't think that bug was in 1.8.1.
You could run:
wget http://www.example.com/thing.gz; touch /tmp/thing.gz
to have the file touched after wget exits.
Dave
|
|
|
|
01-27-2005, 04:58 AM
|
#10
|
|
LQ Newbie
Registered: Nov 2004
Posts: 26
Original Poster
Rep:
|
yes ilikejam, I think it would be a great idea
Thanks alot.
Last edited by ines; 01-27-2005 at 04:59 AM.
|
|
|
|
01-27-2005, 04:59 AM
|
#11
|
|
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109
Rep:
|
Actually, if you want to be really sure, you could do:
wget http://www.example.com/thing.gz; while true; do touch /tmp/thing.gz; sleep 300; done;
That would touch the file every 5 minutes, so it would look like the file is being used.
Dave
|
|
|
|
01-27-2005, 08:22 AM
|
#12
|
|
LQ Newbie
Registered: Nov 2004
Posts: 26
Original Poster
Rep:
|
I understand now why my files disappear.
In fact, while being donloading, files have as date the current date. Once download is finished they acquire the date they got from their original source (the date they have on the site from which they are downloaded). So that, the 240 hours are largely exceeded and files are deleted.
|
|
|
|
01-27-2005, 09:16 AM
|
#13
|
|
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109
Rep:
|
Very interesting. I didn't know that happened.
Using 'touch' after downloading should do the trick.
I'll have to remember that.
Cheers.
|
|
|
|
01-28-2005, 03:35 AM
|
#14
|
|
LQ Newbie
Registered: Nov 2004
Posts: 26
Original Poster
Rep:
|
ilikejam,
tank u gain for your help
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:32 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|