home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] Simple Chron Job request

What language do you plan to write this job in? 

If you want a random interval it’s far simpler to skip cron and code a loop in your test application with a random interval.

Mike

> On Jun 3, 2016, at 2:38 PM, Trevor James <james [ at ] telfer [ dot ] uottawa [ dot ] ca> wrote:
> 
> Good Day everyone, I know this is one that someone in the know can do in about 2 minutes and will take me a couple of hours of google time to figure out.
> 
> I would like to set up a chron job to add a record to a database in MySQL.
> 
> Background, I wish to do a reasonable test of our backup system on MySQL databases.
> 
> I have a TurnKey LAMP server setup, so now I wish to add a record to a table in a database (I haven't set anything up just yet it will depend on the data I can push into the table)
> 
> I can go into MySQL create Database, Create Table etc, so that is ok, so let's assume I have TestDatabase with TestTable with one field called TestData (type can be anything, but how about a date/time or string)
> 
> Now I would like to set up a chron that every X minutes (I would like something semi random, but let's say every 83 minutes if it is easy) add a new record to the database
> 
> date > mysqldatabse
> 
> Then between backups I will kill the machine and restore from backup and then run a mysqlcheck on the database.
> 
> In theory we should have dataloss (since the backup is not continuous) which is acceptable, a corrupted database will not be which is what I wish to verify
> 
> Thanks in advance for any assistance you can give.
> 
> T. James
> _______________________________________________
> Linux mailing list
> Linux [ at ] lists [ dot ] oclug [ dot ] on [ dot ] ca
> http://oclug.on.ca/mailman/listinfo/linux


references