Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIP -- Creating a Cron Job for MySQL Database Cleaning
08-20-2010, 09:30 PM, (This post was last modified: 08-20-2010, 09:40 PM by teasers.)
#1
TIP -- Creating a Cron Job for MySQL Database Cleaning
Here is how you create a cron job on your server for performing a 'cleanAllOlder' task:

1- Login to your server using SSH

2-
Quote:cd /etc
nano crontab

3- add following code to your crontab file, replacing 'YourURL' (and 'jabbercam', if different) with the one below
Quote:0 * * * * /usr/bin/wget -q -O /dev/null http://YourURL/jabbercam/admin.php?task=cleanAllOlder

4- exit nano by saving the file:
Quote:CTRL+X
y
ENTER

5- execute:
Quote:crontab crontab

That's it!


Above example sets cron job to run evey hour. Other examples are:
Quote:15 5 * * * every day at 05:15
0 * * * * hourly
* * * * * every minute
*/15 * * * * every 15 minutes
0 2,10,19 * * * run 3 times a day: at 02.00, 10.00 and 19.00 hours
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)