How to backup all your sites every day automatically ?

Discussion in 'Site & Server Administration' started by poseidon, Apr 30, 2006.

  1. #1
    Hi,

    I want to automatically (using cron) backup all my sites. I am having reseller account and have few sites. So probably I will prefer to run only one script in main account which can backup all the sites :)

    Any help/suggestion will be highly appreciated..
    Regards
     
    poseidon, Apr 30, 2006 IP
  2. theblight

    theblight Peon

    Messages:
    246
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    if it is linux

    you might try the tar cvfz command to compress and backup your sites..

    but the downside is it will fill up your allotted disk space. And might as well program or create a script that will just backup the applications/scripts not the images.

    Hope it helps
     
    theblight, May 2, 2006 IP
  3. poseidon

    poseidon Banned

    Messages:
    4,356
    Likes Received:
    246
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ya it is linux but Ionly have cpanel access and not shell. anyway thanks. I will ask my host about this and will write the solution here if I got one :)
     
    poseidon, May 2, 2006 IP
  4. theblight

    theblight Peon

    Messages:
    246
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can still do it through cpanel..but better ask for the system information of how you will code your cron.

    Hope it helps
     
    theblight, May 2, 2006 IP
  5. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Does your host not back up your files and databases for you?

    Mine does an offsite backup every day which they can use to overwrite your current site if there is a problem.
     
    mad4, May 2, 2006 IP
  6. theblight

    theblight Peon

    Messages:
    246
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #6
    well it's much better to do it for your own as added help would also mean additional payment such as restoration....i'll be posting up the script in a bit..
     
    theblight, May 2, 2006 IP
  7. theblight

    theblight Peon

    Messages:
    246
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Create a backup script named:
    backup.script

    backup.script content:

    tar cvfz sitename-$(date +%Y%m%d).tgz /location/of/directory/to/be/backup

    add executable permission to backup.script


    cron entry

    15 00 * * * root /location/of/backup.script
    or how you enter it onto your cpanel

    Hope It Helps
     
    theblight, May 2, 2006 IP
  8. tanfwc

    tanfwc Peon

    Messages:
    579
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Since you are a reseller, there is no solution to backup your sub account to a main account. You need to put the backup script on each account as the cron will only execute on the account user permission.

    You can search around for backup script.
     
    tanfwc, May 2, 2006 IP
  9. poseidon

    poseidon Banned

    Messages:
    4,356
    Likes Received:
    246
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks guys. I will try to what theblight said or better asked my host. He had told me that they do backup every week but that's a very long period. I need to do daily backup.
     
    poseidon, May 2, 2006 IP