Cron Jobs

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 03-17-2007, 01:56 AM
Constant Pligger
 
Join Date: Apr 2006
Location: USA
Posts: 351
I know what to do, I'm just not sure what files to cron!

I would like to be able to remove stories from the queue after so many days. What file is used for this?

I know to import a feed you just cron /rss/import_feeds.php


For others who are looking to cron on a command line interface, here is a quick resource:

http://www.modwest.com/help/kb5-125.html
Reply With Quote
  #2 (permalink)  
Old 03-17-2007, 03:33 AM
Casual Pligger
 
Join Date: Feb 2007
Posts: 35
yes. you just need to cron import_feeds.php
Reply With Quote
  #3 (permalink)  
Old 03-17-2007, 04:06 AM
Constant Pligger
 
Join Date: Apr 2006
Location: USA
Posts: 351
What about for removing stories older than so many days?
Reply With Quote
  #4 (permalink)  
Old 03-17-2007, 11:52 AM
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
The Pligg wiki is down right now. When it's back up I can show you a file that will hopefully do what you want.
Reply With Quote
  #5 (permalink)  
Old 03-17-2007, 12:07 PM
Constant Pligger
 
Join Date: Apr 2006
Location: USA
Posts: 351
Alright, thanks!
Reply With Quote
  #6 (permalink)  
Old 03-22-2007, 08:59 PM
Constant Pligger
 
Join Date: Apr 2006
Location: USA
Posts: 351
Bump* wiki up?
Reply With Quote
  #7 (permalink)  
Old 03-22-2007, 09:03 PM
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
Here is that script I was referring to http://www.pligg.com/wiki/index.php?...stories_script
Reply With Quote
  #8 (permalink)  
Old 03-22-2007, 09:23 PM
Constant Pligger
 
Join Date: Apr 2006
Location: USA
Posts: 351
sweet, thank you very much!
Reply With Quote
  #9 (permalink)  
Old 04-02-2007, 02:56 PM
New Pligger
 
Join Date: Mar 2007
Posts: 16
hi there, thanks for the script, but i am having some problems getting it to work for some reason

just as a test, i went ahead and tried to remove articles that were 3 days old, and it didnt work, any suggestions?

i replacced db host, etc with my information, and than set the time for 3 and 3 for the days

thanks for your time

Code:
<?php

mysql_connect("localhost", "my db name", "my db pass") or die("error1");
mysql_select_db("my db name") or die("error2");

$fourteen_days   = 3;
$now = date("U") - $fourteen_days; 
$ninety_days   = 3;
$now2 = date("U") - $ninety_days; 

$now = date("Y-m-d H:i:s",$now);
$now2 = date("Y-m-d H:i:s",$now2);

mysql_query("delete from links where link_date < '$now' AND link_status = 'queued'");
mysql_query("delete from links where link_date < '$now2' AND link_status = 'published'");
mysql_query("delete from links where link_status = 'discard'");

?>
Reply With Quote
  #10 (permalink)  
Old 04-02-2007, 03:16 PM
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
Quote:
$fourteen_days = 3;

$ninety_days = 3;
the number does not equal days. You have to specify the time in seconds. That's why it looks like this for fourteen days
Quote:
$fourteen_days = 1209600;
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Import of RSS using cron peosteve Questions and Comments 4 10-11-2008 05:40 AM
Story Display on other sites Simon Questions and Comments 32 09-25-2007 08:33 PM
Dreamhost Cron Jobs Yankidank Questions and Comments 0 05-04-2007 03:42 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development