Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old January 28th, 2007, 07:14 PM
ajm113 ajm113 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 339 ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 23 h 47 m 12 sec
Reputation Power: 9
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.

Reply With Quote
  #2  
Old January 29th, 2007, 12:31 AM
Lux Perpetua Lux Perpetua is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Feb 2004
Location: San Francisco Bay
Posts: 1,418 Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 47 m 27 sec
Reputation Power: 334
It depends on the system, but rm *.pk4 would work on a Unix shell.

Reply With Quote
  #3  
Old January 29th, 2007, 05:28 PM
ajm113 ajm113 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 339 ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 23 h 47 m 12 sec
Reputation Power: 9
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.

Reply With Quote
  #4  
Old January 29th, 2007, 07:34 PM
ajm113 ajm113 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 339 ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 23 h 47 m 12 sec
Reputation Power: 9
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.

Reply With Quote
  #5  
Old January 29th, 2007, 11:14 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,442 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 h 43 m 50 sec
Reputation Power: 797
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

Reply With Quote
  #6  
Old January 30th, 2007, 10:53 AM
ajm113 ajm113 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 339 ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 23 h 47 m 12 sec
Reputation Power: 9
Yeah they are. Ill give it a try, thanks.

Reply With Quote
  #7  
Old January 30th, 2007, 12:32 PM
mu's Avatar
mu mu is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Location: Dublin, Ireland
Posts: 174 mu User rank is Sergeant Major (2000 - 5000 Reputation Level)mu User rank is Sergeant Major (2000 - 5000 Reputation Level)mu User rank is Sergeant Major (2000 - 5000 Reputation Level)mu User rank is Sergeant Major (2000 - 5000 Reputation Level)mu User rank is Sergeant Major (2000 - 5000 Reputation Level)mu User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 23 h 12 m 23 sec
Reputation Power: 39
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.

Reply With Quote
  #8  
Old January 30th, 2007, 04:38 PM
ajm113 ajm113 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 339 ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level)ajm113 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 23 h 47 m 12 sec
Reputation Power: 9
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Need to delete all files with .pk4 using cron job!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate 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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway