The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Use cpbackup for backups every 6 hours

Discussion in 'Data Protection' started by dawa, Mar 14, 2009.

  1. dawa

    dawa Member

    Joined:
    Feb 14, 2009
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    I have a cpanel account that has a fourm, and while I could easily run a mysqldump and a cp command as a backup, it would be easier for me to just go ahead and run cpbackup.

    The issue is that cpbackup runs automatically (via my whm settings) for the usual daily, weekly, monthly routine.

    I'd like to, in addition to my existing backups,

    1) run cpbackup every 6 hours just for once cpanel account.
    2) not overwrite the existing. So for example to also save the files as:

    site_backup_031409_0100
    site_backup_031409_0700

    (e.g site_backup_DATE_TIME).

    If anyone can point me in the right direction I'd really appreciate it.
    Thanks.
     
  2. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    cpbackup actually runs the underlying pkgacct command, so you could just run "pkgacct accountname /backup/special" periodically and then move the generated backup file into a time-based filename (use $(date +%xx)).

    There might be smarter/faster/more effective ways to do this with mysql commands and tar or rsync; pkgacct is really slow.
     
  3. dawa

    dawa Member

    Joined:
    Feb 14, 2009
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    thanks. that's very helpful.

    it gave me a file called cpmove-acctName.tar.gz.

    Why is it called cpmove?

    Thanks.
     
  4. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    I would like to have my backups run every 6 hours as well. But I use the incremental system for back ups. If I try to rerun it then it just says daily backups are up to date.
     
  5. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    You can set a cron to run this command and it will update as much as you set the cron to run: /scripts/cpbackup --force

    I am not sure how good this is for the server.
     
  6. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,384
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    To force cpbackups to run I believe you can pass the --force parameter:

    /scripts/cpbackup --force



    dawa, by default the pkgacct script will create a cpmove file. I am not sure if there are any differences between the "types" of backups, but you can resolve this by using:

    /scripts/pkgacct <user> </backup/path> userbackup

    which will create a backup file in the format of backup-m.d.Y_H:m:s_user.tar.gz

    Other options, instead of userbackup, are cpmove and backup. I do know that using userbackup will prevent the backup from storing any other userbackups that exist i your home directory. But as far as a difference between a cpmove file and a backup file, I'm not aware of any structural differences.
     
Loading...

Share This Page