Solved Linux temp files problem

Gigabyte Ga-8ipe1000-g motherboard
March 5, 2012 at 02:02:14
Specs: Mandrake 9.2, Intel ® Pentium ® 4 CPU 2.8 GHz
Hi all,
When I printing from application program, there alot of temp file created inside - root@example ] # home/abc/tmp . In window if we remove from windows\temp location. But in linux I also can remove but everyday have to clean the temp files is make me crazy. Is it any options to disable or stop temp files creation during printing to printer? Please help and advice. Thanks.

Best Regards,


See More: Linux temp files problem

March 5, 2012 at 09:39:41
Temp files are required for a reason; are you sure that you want to prevent creating temp files?

One of the problems that Linux apps have is when do you delete the temp file(s)? Once, I created a problem for myself because I deleted the temp file before the printer was done processing it.

Why don't you create a Linux shell script that runs once or twice a day that deletes temp files that are more than one or two days old? You can automate the process by running it from cron.

If you do not know how to create such a script, I will help you.

Report •

March 5, 2012 at 18:31:19
Yes I don't know how to create. Please . . .

Report •

March 5, 2012 at 22:13:47
✔ Best Answer
This command deletes files that are older than 2 days old in the /tmp directory:

find /tmp -type f -mtime +2 -print|xargs rm -f

I suggest you place the above command in a shell script. Place the command in a file - let's say the file is called To make the file executable:

chmod 755

When you are sure that works come on back and I will tell you how to add the script to cron.

But if you are wondering how cron works, check out this link:

Report •
Related Solutions

Ask Question