Re: Automatically changing data in database
| From: | Marko Vukovic' | Date: | Thu, 24 Aug 2000 15:23:33 +0000 |
| Subject: | Re: Automatically changing data in database | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13442@lists.php.net to get a copy of this message | ||
Siim Einfeldt wrote:
>
> Hmm...I will check it out whether I can or not execute it from the
> command line (it`s not my server, just started using it). But you can
> still give me the notes as the magazine most likely won`t stay on that
> server for very long and the new one will hopefully have all needed
> things enabled..
>
> I don`t know anything about cgi, perl, so any help you can provide with
> cron job, is appreciated....or you could just teach me this thing a bit,
> but I suppose that would be a lot bigger job.
ok, cron jobs are usually setup in /etc/crontab
the line looks something like this:
#minute hour mday month wday who command
0 0 * * * root /path/to/cgi-bin/rotate_article.pl
now it's up to you to write 'rotate_article.pl'.
Have a look around on the web. I'm at work right now so I can't really go looking
for examples - it should be a relatively simple script to write:
#!usr/bin/perl
#require DBI;
etc..etc.. I can't remember the rest right now.
db_exec("UPDATE TABLE articles SET today='no' where today='yes'");
..or something like that...
Once you have written that, 'chmod +x it' and test it:
'/path/to/cgi-bin/rotate_article.pl'
--
Marko