|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Need to delete all files with .pk4 using cron job!
What is the code to delete all files that have a ext of .pk4? I am having this small hosting place for pk4 files and I want it to delete them after a certan time they have been on there.
|
|
#2
|
|||
|
|||
|
It depends on the system, but rm *.pk4 would work on a Unix shell.
|
|
#3
|
|||
|
|||
|
I think I did that command befor but I'll give it another try to see if I did a spelling error or something. Will get back to you on it.
|
|
#4
|
|||
|
|||
|
No it did not work. I am using Cpanel to make this and it does not seem to work I have it run the command every min on the hour and every day and month.
|
|
#5
|
||||
|
||||
|
Are the pk4 files in subdirectories or what? If so, you could do something like this:
/usr/bin/find /path_to_base_dir -name "*.pk4" | /usr/bin/xargs /bin/rm -f
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#6
|
|||
|
|||
|
Yeah they are. Ill give it a try, thanks.
|
|
#7
|
||||
|
||||
|
Note that, If you only want to delete files which are older than a given amount of time you should use something like the mtime switch.
/usr/bin/find /path_to_base_dir -mtime +7 -name "*.pk4" | /usr/bin/xargs /bin/rm -f The above code would only delete pk4 files which are more than 7 days old. |
|
#8
|
|||
|
|||
|
I get the first URL area but on the second URL area I don't get is there supposed to be a difference or both codes are supposed to be the same. I just want to clarify things.
EDIT Also cpanel's cron job keeps hiding the other half of the code. Is this a problem or not? Last edited by ajm113 : January 30th, 2007 at 04:49 PM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Need to delete all files with .pk4 using cron job! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|