Jump to content

ExpireTable Data


phpretard

Recommended Posts

Is there a way to expire table data based on a date.

 

An example would be:

 

I upload information into "field 1"  on 1-1-2008

 

and did not update information in "field 2" by 1-3-2008

 

then the information in field one would be deleted on 1-3-2008.

 

Does this make any sense?

 

 

Link to comment
Share on other sites

It's very easy.

 

$ crontab -l  #Checks current crons for your user
$ crontab -e #Opens your text editor to edit the crontab.  Format discussed below.  The editor it opens can be set by exporting EDITOR, but I think it defaults to nano

 

The format for a crontab line is:

m h dom mon dow command

 

* can be used to represent "every".  So to run an hourly php script, it would be:

0 * * * * /usr/bin/php -f test.php

 

You could probably just use php as the command, but you'll want to make sure it's in your path.  Run:

$ which php
$ echo $PATH

And verify that the folder that PHP is in is inside your PATH, but /usr/bin should always be unless you removed it yourself.

 

Phew, that was annoying to type.

Link to comment
Share on other sites

I don't know about Florida, but in UK, the word retard is frowned upon as an antiquated insult. In reality, in physics it means to slow down, apply a brake, and the statement 'php slow down' doesn't make sense.

 

Also you changed my expression of the word to you yourself, which as Dirk Benedict (Face from A-Team) has just described as being 'passive aggressive', lol.

Don't ya love grammar!

 

 

* Just seen your post *

pretard

So what does the 'ph' stand for?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.