Auto delete users, windows scheduler or unix cron

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
senthil
Forum Newbie
Posts: 12
Joined: Wed Jan 15, 2003 6:42 pm

Auto delete users, windows scheduler or unix cron

Post by senthil »

Hi:

I would like to delete all the users of my (employer's) site, whose account is inactive(did not login) for 30 days. I can write something like, "DELETE from usertable where...". I want to run this every night, check regularly and delete the users. I searched on this topic and found about windows task scheduler and unix cron.

But my problem is, I'm not yet done with the web site, I'm still working on it. I dont know whether it will be hosted in a windows or unix server. I can upload all the html and php files once I get the username and password for the host server space. But how will I specify this auto delete script. Will I be able to access the task scheduler of the host machine or what should I do if its a unix machine (I dont know anything abt unix).

As you might have guessed this is my first website and any reply will be of great help.

Thanks
Senthil
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

It's highly unlikely that a host running a Windows based system is going to let you schedule tasks. Additionally, the Task Scheduler in Windows is extremely unreliable.

If it's a *nix backend (most likely Linux), then it's cron. Just do a search on Google for cron tutorials. You will also need to know if your host has a php executable, normally at /usr/local/bin. There are a couple of tutorials on writing PHP for the command line, and one for using it with ncurses. And don't worry about how well PHP works in this capacity. I do it with three different scripts for my site and three at work.

Just remember, Google is your friend! :twisted:

Cheers,
BDKR
Post Reply