LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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

Reply
 
Search this Thread
Old 01-27-2005, 02:54 AM   #1
ines
LQ Newbie
 
Registered: Nov 2004
Posts: 26

Rep: Reputation: 15
Unhappy 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?
 
Old 01-27-2005, 03:18 AM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
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
 
Old 01-27-2005, 03:20 AM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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.
 
Old 01-27-2005, 03:41 AM   #4
ines
LQ Newbie
 
Registered: Nov 2004
Posts: 26

Original Poster
Rep: Reputation: 15
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.
 
Old 01-27-2005, 03:53 AM   #5
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
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
 
Old 01-27-2005, 04:06 AM   #6
ines
LQ Newbie
 
Registered: Nov 2004
Posts: 26

Original Poster
Rep: Reputation: 15
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.
 
Old 01-27-2005, 04:16 AM   #7
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
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
 
Old 01-27-2005, 04:33 AM   #8
ines
LQ Newbie
 
Registered: Nov 2004
Posts: 26

Original Poster
Rep: Reputation: 15
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.
 
Old 01-27-2005, 04:51 AM   #9
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
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
 
Old 01-27-2005, 04:58 AM   #10
ines
LQ Newbie
 
Registered: Nov 2004
Posts: 26

Original Poster
Rep: Reputation: 15
Thumbs up

yes ilikejam, I think it would be a great idea

Thanks alot.

Last edited by ines; 01-27-2005 at 04:59 AM.
 
Old 01-27-2005, 04:59 AM   #11
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
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
 
Old 01-27-2005, 08:22 AM   #12
ines
LQ Newbie
 
Registered: Nov 2004
Posts: 26

Original Poster
Rep: Reputation: 15
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.
 
Old 01-27-2005, 09:16 AM   #13
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
Very interesting. I didn't know that happened.

Using 'touch' after downloading should do the trick.
I'll have to remember that.

Cheers.
 
Old 01-28-2005, 03:35 AM   #14
ines
LQ Newbie
 
Registered: Nov 2004
Posts: 26

Original Poster
Rep: Reputation: 15
ilikejam,
tank u gain for your help
 
  


Reply


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/tmp files being deleted new@linux Linux - Newbie 2 12-30-2004 01:51 PM
tmp directory being deleted jpokrzyk Linux - General 3 10-30-2004 06:42 PM
Anything in the SuSE 8.2 tmp directory that can't be deleted? alfredh Linux - Newbie 3 12-14-2003 03:41 AM
How to delete the destination files while the source files deleted in cp -u ? myunicom Linux - General 4 09-26-2003 01:13 PM
Numerous scb_*.tmp files in /tmp dburk Programming 3 08-18-2003 04:28 PM


All times are GMT -5. The time now is 01:41 AM.

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