SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,617
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    creating a php script to run as a cron?

    I'm trying to figure out a way to create a php script to beckup both of my databases so I can create a cron out of it.
    Can I get some help?
    Thanks
    "Oh, and Jenkins--apparently your mother died this morning."

  2. #2
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have a look into PhpMySQLAutoBackup, it'll handle producing the SQL file.

    You can then email it (if the info isn't too sensitive) or FTP it to another server.
    I have my own computer setup as an FTP server, and my server cron backs up the DB and puts the file directly on my machine so I don't have to do anything.

  3. #3
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    go to your command line and type 'which php' make a note of your path, then on the first line of your script type the line:
    #!/usr/bin/php
    or whatever the path is, you can then code away a normal php script.

  4. #4
    SitePoint Zealot chrisdpucci's Avatar
    Join Date
    Dec 2006
    Location
    On the internets
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have the php script that backs up your db already written? If so setting up a cron is super simple especially if you have cpanel installed on your server. See my reply in this thread for more info:

    http://www.sitepoint.com/forums/showthread.php?t=454829


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •