Automated Backups

Discussion in 'Apache' started by Omzy, Mar 23, 2009.

  1. #1
    How can I set up automated backups of the files on my webserver, and also the mysql database? I know I will probably have to create a CRON job for this but how do I do this?
     
    Omzy, Mar 23, 2009 IP
  2. MayurGondaliya

    MayurGondaliya Well-Known Member

    Messages:
    1,233
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    170
    #2
    Do you any server control panel software installed on the server like WHM? If yes, WHM has facility to setup automatic backups.
     
    MayurGondaliya, Mar 25, 2009 IP
  3. Omzy

    Omzy Peon

    Messages:
    249
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It's a shared hosting server and I don't believe the server has anything like that installed. I spoke to the tech support guys who said I create a script and get it to run via a cronjob, but I',m not sure how to do this...
     
    Omzy, Mar 26, 2009 IP
  4. Omzy

    Omzy Peon

    Messages:
    249
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Any ideas? You reckon I could create a batch file (on my windows machine) which logs in via FTP/SSH and performs the backup, and sends it back to my maqchine? Is that possible?
     
    Omzy, Mar 31, 2009 IP
  5. lookzovt

    lookzovt Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You can write script which backup and compress your files. Administrator can run it every day/week/whatewer from cron.

    Backup of MySQL you can do by two commands:

    mysqldump -A -c -pyourpassword -ubackup > /backup/mysqlbackup.sql
    /bin/gzip /backup/mysqlbackup.sql

    yourpassword is password for user backup with privilages for reading/backup database
    -A - all databases

    other files you can compress by:
    /bin/gtar -z -c -v --one-file-system -f - /home/katalog > myhome.tgz

    Then you can transfer it to your computer.
     
    lookzovt, Mar 31, 2009 IP