<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1017930" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1017930</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-management/clearing-mysql-database-daily#comment-1105098</link>
    <description> &lt;p&gt;OK... I am my own host and have a server hosted in my location.&lt;br /&gt;
I set that up as you said Mairving and I&#039;m getting cron emails every 5 minutes telling me that cron.weekly cannot run and that the script doesn&#039;t work either&lt;/p&gt;
 </description>
     <pubDate>Tue, 19 Mar 2002 23:23:26 +0000</pubDate>
 <dc:creator>nike_guy_man</dc:creator>
 <guid isPermaLink="false">comment 1105098 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-management/clearing-mysql-database-daily#comment-1104978</link>
    <description> &lt;p&gt;If you have shell access to the system, you setup a cron job using crontab. Here is how to setup a cron job;&lt;br /&gt;
&lt;strong&gt;crontab -e&lt;/strong&gt; opens crontab editor&lt;/p&gt;
&lt;p&gt;Crontab has this format:&lt;br /&gt;
&lt;strong&gt;a b c d e f&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;where...&lt;br /&gt;
&lt;strong&gt;a = The minute after the hour that you want it done&lt;br /&gt;
b = The hour you want it done (Military Time)&lt;br /&gt;
c = Day of the Month&lt;br /&gt;
d = Month of the Year&lt;br /&gt;
e = Day of the week&lt;br /&gt;
f = &#039;command&#039;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So something like &lt;strong&gt;0 0 * * * /home/username/scriptname&lt;/strong&gt;&lt;br /&gt;
would run this script at midnight since it the first value is 0 (minutes), the second value is 0 (hour in military time). The third, fourth and fifth values are * (NULL) which means they are ignored. The sixth value is the script name. It does have to be executable.&lt;/p&gt;
 </description>
     <pubDate>Mon, 18 Mar 2002 13:14:15 +0000</pubDate>
 <dc:creator>mairving</dc:creator>
 <guid isPermaLink="false">comment 1104978 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-management/clearing-mysql-database-daily#comment-1104957</link>
    <description> &lt;p&gt;Now you have to find out from your host how to set up a cron job.  Who is your host, do they give you a control panel?&lt;/p&gt;
 </description>
     <pubDate>Mon, 18 Mar 2002 07:44:35 +0000</pubDate>
 <dc:creator>mhalbrook</dc:creator>
 <guid isPermaLink="false">comment 1104957 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-management/clearing-mysql-database-daily#comment-1104951</link>
    <description> &lt;p&gt;OK i created that file... now what?&lt;/p&gt;
 </description>
     <pubDate>Mon, 18 Mar 2002 03:03:22 +0000</pubDate>
 <dc:creator>nike_guy_man</dc:creator>
 <guid isPermaLink="false">comment 1104951 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-management/clearing-mysql-database-daily#comment-1104946</link>
    <description> &lt;p&gt;It would be pretty standard fare. Something like:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;mysql_connect&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;localhost&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;username&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;password&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) or die(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Cannot connect to the database.&amp;lt;br&amp;gt;\&quot; . mysql_error());&lt;br /&gt;&lt;br /&gt;mysql_select_db(database_name) or die(\&quot;Cannot select the database.&amp;lt;br&amp;gt;\&quot; . mysql_error());&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sql&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;DELETE from tablename\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_query(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sql&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) or die(\&quot;Cannot query the database.&amp;lt;br&amp;gt;\&quot; . mysql_error());&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Do make sure that this file is located below document root, though. I don&#039;t think permissions will matter that much in this case.&lt;/p&gt;
 </description>
     <pubDate>Mon, 18 Mar 2002 02:31:33 +0000</pubDate>
 <dc:creator>mairving</dc:creator>
 <guid isPermaLink="false">comment 1104946 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-management/clearing-mysql-database-daily#comment-1104942</link>
    <description> &lt;p&gt;What should the PHP file look like and what should its permissions be?&lt;br /&gt;
I looked at that site and I&#039;m still confused...&lt;/p&gt;
 </description>
     <pubDate>Mon, 18 Mar 2002 00:43:59 +0000</pubDate>
 <dc:creator>nike_guy_man</dc:creator>
 <guid isPermaLink="false">comment 1104942 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-management/clearing-mysql-database-daily#comment-1104929</link>
    <description> &lt;p&gt;Emptied means delete everything, no coming back&lt;br /&gt;
No need for a backup, everythign is saved twice, one keeps daily records, another keeps lifetime records, daily are only used  once&lt;br /&gt;
I&#039;ll work with making a cron job&lt;br /&gt;
Thanks&lt;/p&gt;
 </description>
     <pubDate>Sun, 17 Mar 2002 18:49:11 +0000</pubDate>
 <dc:creator>nike_guy_man</dc:creator>
 <guid isPermaLink="false">comment 1104929 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-management/clearing-mysql-database-daily#comment-1104928</link>
    <description> &lt;p&gt;By emptied do you want to keep the data that is in the database? If so you would have to output it to a file or dump the database. You could have problems if you have some auto-increment fields in your database keeping the auto_incremented number from repeating.&lt;/p&gt;
&lt;p&gt;A cron job is about as old as the hills. It is a service that runs on &#039;nix based systems that allows you to run system commands on a timed basis. You can schedule it to run daily, hourly, every 15 minutes, etc. Most hosts would have a way to set up a cron via the control panel. If you have shell access, then you can pretty easily setup a cron. &lt;a href=&quot;http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=388&amp;amp;lngWId=8&quot; class=&quot;bb-url&quot;&gt;Here&lt;/a&gt; is an article about setting up a cron job for a php script.&lt;/p&gt;
 </description>
     <pubDate>Sun, 17 Mar 2002 18:43:40 +0000</pubDate>
 <dc:creator>mairving</dc:creator>
 <guid isPermaLink="false">comment 1104928 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-management/clearing-mysql-database-daily#comment-1104915</link>
    <description> &lt;p&gt;By emptied, I mean that there are no more rows in the DB&lt;br /&gt;
What is a cron job and how do they work?&lt;/p&gt;
 </description>
     <pubDate>Sun, 17 Mar 2002 16:04:17 +0000</pubDate>
 <dc:creator>nike_guy_man</dc:creator>
 <guid isPermaLink="false">comment 1104915 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-management/clearing-mysql-database-daily#comment-1104906</link>
    <description> &lt;p&gt;Yes, I guess it is how you define emptied. If you mean emptied as in data deleted, you could as mhalbrook says write a script and assign the script to a cron job. If you want to keep the data from the table, you could write a script that would dump the db, drop the db and recreate the db. Or if it was just one table that you wanted to save data from, then you could do a &lt;strong&gt;SELECT * from table into local outfile &quot;/home/username/dailydata.txt&quot;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;PHP or PERL would work as the scripting language.&lt;/p&gt;
 </description>
     <pubDate>Sun, 17 Mar 2002 12:35:50 +0000</pubDate>
 <dc:creator>mairving</dc:creator>
 <guid isPermaLink="false">comment 1104906 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
