Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 1 of 1
  1. #1
    Member
    Join Date
    Apr 2007
    Posts
    7

    Default rsync Server Backup, Minor Issues After Restore

    For about 4 years now, I've been doing daily backups (in addition to other backups) of my entire cPanel server with rsync.

    To do so, on another server with an identical size, identically partitioned hard drive as a secondary drive, I have been having cron run the following (in a shell script) early every morning:
    Code:
    rsync -azx -e ssh --delete server.example.com:/boot/ /mnt/server_backup/boot/
    rsync -azx -e ssh --delete server.example.com:/tmp/ /mnt/server_backup/tmp/
    rsync -azx -e ssh --delete server.example.com:/ /mnt/server_backup/
    "/tmp" and "/boot" are separate partitions, and yes, I know that copying "/tmp" is not necessary.

    Yesterday, not realizing what I was doing, I deleted "/home/virtfs", which, due to the fact that much of its contents are bind mounts to other actual parts of the system, caused catastrophic system failure.

    I was able to take the backup hard drive out of the other server and get this broken server to successfully boot from it. Everything seems to be working great including websites, email, and databases (all OK according to mysqlcheck).

    Here comes my issue:

    When I did the rsync backups as above, I have never used the "-H" (preserve hard links) option. I also don't think that that option would have applied to the "/home/virtfs" bind mounts (as they aren't actually hard links).

    Now, there is absolutely no mention of "virtfs" in the output of "cat /proc/mounts" or the "mount" command. "/home/virtfs", however, is taking up about 5GB on the hard drive. I tested some of the files in "/home/virtfs/<username>/bin" to see if their inode numbers matched the inode numbers of the files with the same names in "/bin"; they didn't. I have also made sure that every account is not set to use the jailed shell.

    Also, from my memory, it seems that some other places on a normally working CentOS 5.5 cPanel server use hardlinks. The Apache access logs come to mind, as I think they have the domain filenames in "/usr/local/apache/domlogs" and also the copies of the same in each "/usr/local/apche/domlogs/<username>" directory.

    Does anyone forsee any problems I will have with files that were once hardlinks on the drive now instead being actual copies, other than that they are taking up extra space by being duplicates?

    Can I now safely delete "/home/virtfs" to free up the space its occupying, as it seems to now just contain duplicate files rather than bind mounts?

    Are there other places on the system besdies "/home/virtfs" that I can delete things that were once hard links or bind mounts but are now just duplicates taking up more space?

    For my future rsync backups, should I use the "-H" option?

    Any thoughts on this would be highly appreciated.
    Last edited by Magotchi; 02-16-2011 at 03:02 PM.

Similar Threads & Tags
Similar threads

  1. Rsync script for backup of cpanel server
    By zigzam in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 06-08-2009, 01:54 PM
  2. Backup Issues: whm or rsync dont do incremental plus mysql dump questions
    By vladgur in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 03-18-2008, 12:40 PM
  3. Backup alternative: rsync + external server
    By stormrider in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-05-2008, 09:18 PM
  4. couple of minor issues
    By Secret Agent in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-26-2004, 04:45 PM
  5. Some frustrating backup/restore issues
    By ellijay in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-10-2003, 02:24 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube