|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
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).
|
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
When shelled in... try crontab -e. You should be able to set crontabs at the non-root level.
sunphp |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > using CRON |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|