Hello,
Is it possible to write a php script and have it automatically excecute at a certain time everyday? I need to write a script that will do garbage collection on my database everyday. I do not have a whole lot of power over the hosting server and I can't upload a java program or write a shell script to do this. Many thanks in advance.

Member Avatar for iamthwee

I'd probably run it as a scheduled task on windows.

For linux do man cron

what i like to do is put some ajax on the main page of my website so that the php code will execute every time someone accesses your page and do the garbage collection you need. i don't know if this would work for you but i works quite well for me.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.