Results 1 to 10 of 14
-
16th Sep 2010, 02:52 AM #1OPMember
Need php cronjob to auto dlete files after XX hours [$5]
Hey guys, I needthis PHP cron job script which can automatically delete files within a partiuclar folder, after like 12 hours, corresponding to the 'Last Modified' Date of the file.
Note: I'm NOT looking for cron to remove files every 12 hours..
$5 to someone who can code itkohkindachi Reviewed by kohkindachi on . Need php cronjob to auto dlete files after XX hours [$5] Hey guys, I needthis PHP cron job script which can automatically delete files within a partiuclar folder, after like 12 hours, corresponding to the 'Last Modified' Date of the file. Note: I'm NOT looking for cron to remove files every 12 hours.. $5 to someone who can code it Rating: 5None
-
16th Sep 2010, 02:55 AM #2Member
hmm... make a php file to delete files and execute that after every 12hrs through cron job ??
-
16th Sep 2010, 02:57 AM #3OPMember
-
16th Sep 2010, 03:37 AM #4MemberWebsite's:
sborg.usSo you basically need a php script, to put in cron jobs and the script deletes a specific file depending on the modified time?
Or you don't wanna use cron jobs but make the script run forever to check modified time and delete the file?
-
16th Sep 2010, 03:51 AM #5MemberWebsite's:
LulzCovers.com LulzTroll.comPHP Code:
<?php
$path = "yourfilespath";
$handle=opendir($path);
while (false!==($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$Diff = (time() - filectime("$path/$file"))/60/60/24;
if ($Diff > 1) unlink("$path/$file");
}
}
closedir($handle);
?>Contact me for Traffic, SEO, WCDDL, Wordpress, IPB related Services or queries.
Template Designing, PSD to HTML, Wordpress
-
16th Sep 2010, 03:52 AM #6OPMember
@V3g3t4, I want the php script to run in cron. Actually doesn't have to be PHP if u can cdoe it in sh
None
-
16th Sep 2010, 03:54 AM #7MemberWebsite's:
LulzCovers.com LulzTroll.comsave the script as del.php
and use
php /home/xxx/public_html/../del.php ( i.e your script path)
and it will run in cron via cpanelContact me for Traffic, SEO, WCDDL, Wordpress, IPB related Services or queries.
Template Designing, PSD to HTML, Wordpress
-
16th Sep 2010, 03:54 AM #8OPMember
@deAthbLisS, let me try thx
can you tell me their time formate? So that i can change it myself. I mean how do i changed it to 12 hrs etcNone
-
16th Sep 2010, 03:56 AM #9MemberWebsite's:
sborg.usI thought you didn't want cron jobs to be used. lol
Well deathbliss' one will work in your case
it's TotalTime/60(for sec)/60(for min)/24(for hrs)
@Death, I think filemtime() is to be used.
-
16th Sep 2010, 03:59 AM #10OPMember
Thanks. Now i would like to interprete it lol
$Diff > 1
what is this about?
maybe you can show me the code to auto delete after 6 hours? so that i can see what's going on
None
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
How to Auto RaR Files
By cotufa-ssdd in forum Tutorials and GuidesReplies: 27Last Post: 19th Oct 2012, 07:30 AM -
simple cronjob involving mono and a screen
By pisoj1 in forum Community CooperativeReplies: 0Last Post: 27th Nov 2011, 11:16 AM -
[Selling] Wautoposter Fully Automated Bot Script RSS FEED Auto Download Auto Upload
By jpavsex in forum Completed TransactionsReplies: 302Last Post: 10th Jul 2011, 09:30 AM -
[Buying] Auto Download Auto Upload Auto Post
By arkinyildiz in forum Completed TransactionsReplies: 20Last Post: 7th May 2011, 03:28 PM -
cronjob setup in cpanel
By pirateaccess in forum Webmaster DiscussionReplies: 1Last Post: 15th Jun 2009, 06:54 PM
themaCreator - create posts from...
Version 3.24 released. Open older version (or...