Ubuntu :: Does Apache2 Have A Way To Automatically Delete Temp Files
May 1, 2010
I have a PHP script running on my website that can generate temporary images, but if I clean them up right away, then the browser doesn't have time to render them.Is there some way to make Apache2 delete them after 5 minutes or so?
I have a PHP script running on my website that can generate temporary images, but if I clean them up right away, then the browser doesn't have time to render them. Is there some way to make Apache2 delete them after 5 minutes or so?
we have 2 linux desktop m/c as server and we use amc n windows as clients....we get more temp files like .AppleDoueble, ":2edstore".i need to remove these temp files periodically with the script. how to write a script to remove these temp files.....
I have a shell script that need to create some files:
1) backup files of user passed in file ( that will be written by this shell ).
2) temp files that the shell will create and later delete/remove.
This shell script will be used from my local dir ( I am not a super or a sysadmin ). Users of this shell will call this script to run on their local files in their respective directories. When my script runs, it errors with the following:
for the temp I was able to avoid this error by creating the temp file in the /tmp directory. All I want is for this shell script to run, create/modify/backup files in user's local dirs.
I have a script running as a cronjobIt outputs logs upon each run to /var/log/mylog.logIs there anyway I can delete this or compress it when it gets too large?A cheap and dirty way is to setup another cronjob to delete the log every X interval.... although I'm not sure if that's the proper way
I have server running ubuntu. There is folder /var/netflow and I have there files, which creates every 5minutes new ones(monitoring traffic on network). And I need to delete files older than 6 months manually. Can you help?
I am facing a problem in Windows due to a virus called Newfolder.exe which creats files with the same name as it's parent directory and an extension .exe and this happens for every directory in the entire hierarchy in the infected pen drive. The antivirus detects them, but is sucking slow. So I thought this is a good opportunity to use the concepts of the all mighty shell script to remove those as they follow the same pattern. Say my complete path is
Code:
/home/pkd/fol1/
The virus would have created an file with complete paths
Quote:
/home/pkd/fol1.exe
If fol1 has two more directories fol11 and fol12 Then there would be two more .exe(virus created) in the following path
I have a web server whos DocumentRoot is:/tmp/wwwNow, /temp/www/fake/ is a directory that contains a series of other files/folders.What I want to do is access the files in /temp/www/fake as if they were in the root directory (/temp/www/)For example:
could either be located in "/temp/www/test.php" -or- located in "/temp/www/fake/test.php"
so "http://127.0.0.1/test.php" would essentially call both directories. Is this possible? Whould I do this through apache or through the actual file system somehow? (Like some sort of symbolic link?) I would love to hear your input.
Where are temp files stored in SuSE 11.0? I am trying to find all of those videos and .jpgs and other miscellaneous files I've downloaded in the past, and which are now only taking up space on my hard drive. I'd like to clean out all of that. I have looked in both /tmp and in /.kde but don't see what I'm looking for.
I am trying to use an old box as backup server. I have tried a couple of possibilities along the lines of:
Quote:
rsync -a --delete --progress --log-file=/home/$USER/info.txt -e ssh /home /etc root@192.168.0.106:/mnt/back
The problem is it does not delete files that has been removed from my local system? I run the command as root on the local system.
(I realize I should properly not ssh into the server as the server's root but I'm having trouble with the permissions and I want to make sure everything else works before messing around with it)
I'm using Opensuse11.4 and have kmail and Firefox. When I click a url: link in kmail it opens a new tab in Firefox. The problem is that the url is linked to my temp cache files as this file:///var/tmp/kdecache-terry/krun/1589.0.ctt
The tab this opens has most of the link icons stripped out and the links to other parts of the website don't work and I get a "file not found" error and the link is to a file which doesn't exist file:///contribute.php3
This is only a minor annoyance as I can right click > copy the url and paste it to the address bar in Firefox then it works ok. I don't think it anything in either programme that's broken because this happened after an update to Opensuse 11.4 on my previous laptop and has happened again on my new laptop with a fresh install.
I just can't stand knowing that there's a slight problem with my PC.I have roughly 12.5 Gigs of files, mostly movies that are multiple clones of a particular movie (which was an entirely different problem altogether) and I CANNOT DELETE THESE THINGS! There has to be a simple way to do it from terminal, problem is, I can't seem to find the trash directory in terminal.
I have an NTFS file system nfs-automounted on our RedHat servers. Users can read and write to the file system no problem, and can create new files, edit them, and delete them to their heart's content. The only issue is that utilities such as "dos2unix" cannot create temporary working files:
$ dos2unix events.0818.dat dos2unix: converting file events.0818.dat to UNIX format ... Failed to open output temp file: Operation not permitted dos2unix: problems converting file events.0818.dat
This isn't limited to "dos2unix"; any other utility that creates a temporary working file gets the same problem. If I copy the file to a local file system like /tmp, it works fine. Here's the kicker: this works fine on Solaris systems. I can take the "dos2unix" utility over to a Solaris system that has that exact same NTFS file system automounted via NFS, and it works. No issues creating temporary working files at all.
Is there a way to automatically remove the old linux image when a new one is updated?
When my system boots up it shows option Ubuntu kernel version x.x.x-21 Ubuntu kernel version x.x.x-22 Ubuntu kernel version x.x.x-23 Ubuntu kernel version x.x.x-24 memtest memtest + console Windows 7 loader
Ubuntu seems to boot up the exact same regardless if I choose version 21 or 24. Dont recall the exact kernel since I am not in front of my computer now.
I'm using squid as a proxy in our organization. My problem is whenever the squid cache folder size exceeds 3 GB our proxy server starts to hang. Is there a way to write a script that it will automatically delete the squid cash when it exceeds the 3GB limit.
How can I automate the following: When I insert a flash drive into any of the available USB ports, some kind of script or software, must automatically mount it, delete everything off the flash drive, copy an audio file back to it and then automatically unmount the USB.Maybe I should setup some kind of Kiosk to use the above functionality - would that be easy?
It seems to me that the /tmp folder is currently crowded with old stuff. How can I tell CentOS to always automatically delete all /tmp folder content just before shutdown?
I am administrating a lab in a university and every semester we need to delete all the home folders of the accounts for the next semester. I would like to make a bash script that does this automatically and having trouble with it. Note that I am writing my very first bash script. What I need to do is make a script to delete the following:
Delete everything in /home/$exp$num/$dir when "exp" could be either "rt", "ic" or "sp". "num" could run from 1(single digit) to 45 and dir is "profile" and "work".
This is what I tried to write:
Code:
#!/bin/sh cd /home for exp in "rt ic sp" do
[code]....
What seems to be the problem is the reading of "$exp$num" as a joint expression.
I have apache2 installed along with php5 and mysql5.0. I have installed them by themselves along with just installing the full LAMP install through terminal. My problem is that I cannot parse php files, it will just download them instead. I did change my apache server to nick/projects (nick is my username). If I navigate to localhost/index.html it works fine but will not parse the php files I have put there. I also have rails working fine in that folder too using apache2.
the permissions for my home directory were accidentally changed from 'access files' to 'create and delete files', and I changed them back, but ever since then I am not able to change any preferences/settings at all. power management, themes, panels, emerald, anything. my user account is supposed to be the administrator, and all the user privliges are checked. how to get control of my computer back?
I've deleted /etc/apache2 and did run: Code: sudo apt-get -o DPkg::Options::="--force-confmiss" --reinstall install apache2.2-common to get the default config back.
But starting the server via: Code: sudo /etc/init.d/apache2 results in:
Code: Syntax error on line 161 of /etc/apache2/apache2.conf: Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration line 160-163 look like this:
Code: <Files ~ "^.ht"> Order Allow,Deny # line in question Deny from all </Files>
The funny thing is that the exact same definition is in a debian lenny server config on another server. So why did this install a not working config?
I just removed apache2 via: Code: sudo aptitude remove apache2 sudo rm -r /etc/apache2 and reinstalled it via: Code: sudo aptitude install apache2 which also did not fix the config bug?
For testing I installed apache2 on another ubuntu 9.10 and did just copy the folder /etc/apache2 to my local installation - this fixed the problem. Still, why cant I reinstall apache2 with a working config?