phpretard Posted September 2, 2008 Share Posted September 2, 2008 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? Quote Link to comment Share on other sites More sharing options...
rarebit Posted September 2, 2008 Share Posted September 2, 2008 when selecting use a where greater than date... then you'll need to run a cron job to remove or backup the old data... Quote Link to comment Share on other sites More sharing options...
phpretard Posted September 2, 2008 Author Share Posted September 2, 2008 Could you point me to an EASY cron manual? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted September 2, 2008 Share Posted September 2, 2008 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. Quote Link to comment Share on other sites More sharing options...
rarebit Posted September 2, 2008 Share Posted September 2, 2008 if you wern't such a retard (I really hate that word!), you would have stated what system you need it for! Quote Link to comment Share on other sites More sharing options...
DarkWater Posted September 2, 2008 Share Posted September 2, 2008 if you wern't such a retard (I really hate that word!), you would have stated what system you need it for! It had better be Linux. *dirty glance* Quote Link to comment Share on other sites More sharing options...
rarebit Posted September 2, 2008 Share Posted September 2, 2008 i fink the name states newt jimm'eh Quote Link to comment Share on other sites More sharing options...
phpretard Posted September 2, 2008 Author Share Posted September 2, 2008 Why do you hate me? I didn't do anything but ask a question. Thank for your help!!! It's off to cron with me. Quote Link to comment Share on other sites More sharing options...
phpretard Posted September 2, 2008 Author Share Posted September 2, 2008 I think you've read read my screen name wrong. It's ph-"pretard" I am sorry you have retardphobia Quote Link to comment Share on other sites More sharing options...
rarebit Posted September 2, 2008 Share Posted September 2, 2008 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? Quote Link to comment Share on other sites More sharing options...
phpretard Posted September 2, 2008 Author Share Posted September 2, 2008 Parent Hating ... Pretard Quote Link to comment Share on other sites More sharing options...
rarebit Posted September 2, 2008 Share Posted September 2, 2008 "Problems and solutions are always on an unbalanced scale. The more complex the problem seems the more simple the solution becomes. When your scale is balanced you've become imortal." - Anthony Lariscy Quote Link to comment Share on other sites More sharing options...
phpretard Posted September 2, 2008 Author Share Posted September 2, 2008 I really apprieciatte what Mr. DarkWater has put together for me up thier. Does that all go into one file? What I have read/searched and what you have ther now have me confused. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted September 2, 2008 Share Posted September 2, 2008 You'd probably want to run something similar to this: $ export EDITOR=emacs $ crontab -e Then just type your command into the file and save. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.