General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 20th, 2003, 03:32 AM
Alicia Alicia is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 117 Alicia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 30 m 29 sec
Reputation Power: 6
using CRON

Hi guys,

I was told that i can automate my PHP site using CRON. I read some of the reference book and it seems like i need access crontab from shell and run certain command. The problem is i am not administrator of the server. Hence i dun think i can key in such command to try. Is there any ways i can perform the tasks that can be done by using CRON ? Can i use PHP code to perform such tasks ?

P.s: i want to do automated tasks like remove users that didn't login for 2 weeks from the database, send enews to clients in the mailing list once a month and etc by using CRON.

Please advise.

Reply With Quote
  #2  
Old October 20th, 2003, 07:59 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
If you don't have access to cron, the only thing I know of for you to do is to add code to your login or some other frequently-used script that, when needed, executes and performs these cleanup tasks. So, for example, you might have a code block that checks the date against a stored date and, if it's been two weeks since the last clean-up, runs a bunch of clean-up code. Else it'll just pass over the test and add no significant overhead to the script. This'd work only if you have a fair amount of usage (at least one session a day would do the trick, and, arguably, if you're not having a higher volume of traffic than that, clean-up isn't necessarily an issue anyway).

Reply With Quote
  #3  
Old October 21st, 2003, 05:47 PM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
I suggest you create a batch script which performs the proper mysql query and have it run from your home computer under at (windows task scheduler).

This is how I backup over 20 mysql databases unattended.
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
  #4  
Old October 22nd, 2003, 07:08 PM
sunphp sunphp is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Florida
Posts: 3 sunphp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
When shelled in... try crontab -e. You should be able to set crontabs at the non-root level.

sunphp

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > using CRON


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 5 hosted by Hostway
Stay green...Green IT