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.

How to backup

Discussion in 'General Discussion' started by Stanleytiew, Jun 19, 2005.

  1. Stanleytiew

    Stanleytiew Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    I only have one hard disk installed in my server and wonder how to do a good backup just in case the server crash and I can restore it back in shorter time. I read the documentation for WHM and it is not recemmended to backup to /home, can anybody recemmend the best solutions for backup.
     
  2. Dhp4

    Dhp4 Member

    Joined:
    Jul 12, 2004
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Best way would probly be to backup to a /backup partition, just so if your customers screw up their site you can restore it. Then once a week send the /backup to a remote location.

    This is atleast, what I do.
     
  3. Stanleytiew

    Stanleytiew Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    do you mean creating a partition in /home and backup files to this dir?
     
  4. Dhp4

    Dhp4 Member

    Joined:
    Jul 12, 2004
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    No, i mean haveing a seperate partition, but if you cant do that (most partitioning requires a OS reload) then just have it backup to a remote FTP site - but you need to watch your bandwidth when doing that.
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You can always simply create a backup directory at the / (root) partition, i.e:

    mkdir /backup

    And then configure WHM backup to use that. A few gotchas:

    1. / needs to have enough disk space to hold your backups

    2. If you have a HD failure, you've lost all your data and backups
     
  6. Stanleytiew

    Stanleytiew Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    Thank you very much for your assistance, I will backup to root and then transfer the files back to my local hard disk every week. If you have any backup software that can do a good job and affordable, please recemmend to me. I'm looking for software that can clone the server to my local hard disk remotely.
     
  7. macooper

    macooper Member

    Joined:
    May 3, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Hi,
    the best solution I've found for remote backups is rsnapshot. Basically, it uses rsync to copy files between servers. The main advantage is that it makes extensive use of hard links, so uses little more space than an incremental backup would take (although you need lots of inodes on the filesystem). It's also free, and has a good howto on the site.

    HTH,
    Martin
     
  8. Stanleytiew

    Stanleytiew Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    I have backup everything to root at /backup dir and later move all the files to /home/backup and use the ws_ftp to transfer the files to my local hard disk. /home/backup is an account that I created in whm in order for me to access using ftp software, the error I am getting is 550 alpaprec.tar.gz: Permission denied. I'm unable to transfer the files to my local hard disk, Can anybody help.
     
  9. macooper

    macooper Member

    Joined:
    May 3, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Hi,
    assuming the new user account is called backup, you will need to change the ownership of the archives to that user. When you copied the files, you will have been logged in as root, so the files will still be owned by root, hence the permission denied issue.

    To change the ownership of the files, login as root via ssh and use the commands :-

    cd /home/backup
    pwd

    At this point, ensure that pwd returns the correct directory. This is just a safety check, as the last thing you want to do is run this command from the wrong directory as root. To be on the safe side, change the ownership of each file in turn with the command :-

    chown backup file.tar.gz

    where 'backup' is the login for the account concerned (which is usually the same as the directory name, but doesn't have to be depending on how you set the account up). file.tar.gz should be the name of the file you wish to transfer.

    If you have lots of files, you can use wildcards instead with the command :-

    chown backup *.tar.gz

    This command, as you can probably guess, changes the ownership of all files ending in .tar.gz. Be careful, if you inadvertantly change the ownership of the wrong file, it could cause you all sorts of problems.

    Martin
     
  10. Stanleytiew

    Stanleytiew Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    Thank you very much for your kind assistance. I still have one problem to be solved, when backup to the root, my disk space in 'disk sda6' is full. I wonder anyway to set the backup to them /home/backup. I try to set backup destination to /home/backup but nothing had been backup.
     
  11. macooper

    macooper Member

    Joined:
    May 3, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Well you could just change the path from WHM in the 'Backup>>Configure Backup' section. When you go to that page, just change the 'backup destination' setting to /home/backup. As far as I am aware, this works, but WHM states 'Setting this to /home is a VERY BAD IDEA.'.

    In your position, I would manually backup your /home directory and transfer the data to a different machine. Then login as root, shutdown cpanel and anything else that might be accessing the /home partition, then delete that partition and create a smaller one.

    Basically, you will need to use fdisk to delete the existing /home position, then create 2 smaller partitions (one for /home, one for /backup). Then you will need to create filesystems on each one with a command such as :-

    mkfs -j /dev/hda3

    which will create an ext3 filesystem on the third partition of the first ide disc. Once you have both partitions formatted, edit the file /etc/fstab and copy the old line for the /home mount. Paste that line at the end of the file, and change the /home mountpoint to /backup then change any referances to the old /home partition to match your new partitioning scheme. Save the file, then remount the filesystems with the command :-

    mount -a

    Finally, restart cpanel and anything else that you shutdown. Sorry for the rather confusing overview, but to give you more specific information I would need to know more about your filesystem layout.

    Martin
     
  12. Stanleytiew

    Stanleytiew Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    Thank you very much for your assistance. I think the easier way is to install one more hard disk to the server, so backup will be easier. If I add one more hard disk to the server, is there any other things that I need to do beside formating the hard disk using Linux CD. my current OS is Centos 3.5 running on WHM 10.1.0 and cpanel 10.2.0-R82
     
  13. Stanleytiew

    Stanleytiew Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    Can anybody help on this problem, I backup my files to /home/backup dir, everything is working well and when I use ssh I can see all the files is there, but when I try to transfer the files to my local hard disk using ftp, I can't see the files, only the folder is there. I think the files in hidden mode, how to make it viewable on ftp mode.
     
  14. selfg

    selfg Member

    Joined:
    May 1, 2004
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    macooper wrote about file ownership above. Your backup files are owned by root and when you ssh to your server you no doubt logged in as root, so you can see the backup files. However, when you ftp to your server you are likely using some other account (a different user name), and that account will not have access to root's files. macooper (above) describes how to change file ownership, which should help you. However, I believe you'll have to change the ownership back to root before your next backup cycle.

    --George
     
  15. Stanleytiew

    Stanleytiew Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    Thank you very much for your assistance, you are very helpful. I can see the files when copy to new folder and can transfer the files after 'chown'.
     
Loading...

Share This Page