I Was Wrong

Ken Ray kray at sonsothunder.com
Wed Dec 28 15:46:15 EST 2005


On 12/28/05 10:55 AM, "Dom" <mcdomi at free.fr> wrote:

> Thomas McGrath III <3mcgrath at adelphia.net> wrote:
> 
>> Does any one know where these files live?
> 
> you would like to debut at:
> 
> http://www.afp548.com/article.php?story=20050103223643995
> 
> "One of the most essential, and misunderstood, server admin skills is
> being able to maintain a crontab file. The syntax of the crontab file
> though has been known to drive a sysadmin to drink."
> 
> ;-)

Here's an example I use to set up a cron at 2:00am every morning to backup a
mySQL database called "mydb". Basically you create a crontab file and then
call "crontab" on it (watch for line wraps):

  put "~/mydbcron" into tCronFile
  numToChar(10) into tCronData
  put format("0\t2\t*\t*\t*\t") & \
    "/usr/local/mysql/bin/mysqldump -u root mydb > ~/Documents/mydbsql" & \
    numToChar(10) into tCronData
  put tCronData into url("binfile:" & tCronFile)
  get shell("crontab ~/mydbcron")
  if it <> "" then
    answer error it titled "Cron Status"
  else
    answer "Backup has been set for 2:00 AM every day." titled "Cron Status"
  end if
  delete file tCronFile

Hope this helps,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list