1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Linux Linux Backup

Discussion in 'Software' started by deathtaker27, 19 Jul 2015.

  1. deathtaker27

    deathtaker27 Modder

    Joined:
    17 Apr 2010
    Posts:
    2,238
    Likes Received:
    186
    Hi all,

    need some advice on backups, I have a cloud mail server (postfix/dovecot) and I need to back it up, trying to work out the best way possible, (I plan on having a vm at this end for easy restore in case of an issue)

    option1: tarball the system and then scp or ftp it to my replication host (server-yymmdd-hhmm)

    option2: rsync to a live replica (would mean if there is an issue it would replicate it across?)

    I have never worried about backing up a server before so advice would be highly appreciated,

    DT.

    ps: if anyone could send some test emails to my server i would also appreciate it, pm me for the domains :)
     
  2. Gareth Halfacree

    Gareth Halfacree WIIGII! Lover of bit-tech Administrator Super Moderator Moderator

    Joined:
    4 Dec 2007
    Posts:
    17,090
    Likes Received:
    6,639
    Option 2A: use rsync's backup facility to create multiple, independent, incremental backups on a schedule of your choosing: http://www.mikerubel.org/computers/rsync_snapshots/
     
  3. deathtaker27

    deathtaker27 Modder

    Joined:
    17 Apr 2010
    Posts:
    2,238
    Likes Received:
    186
    Need some more help, thank you very much Gareth but after assessing i have a pretty safe bet that once per day is fine, however that rsync snapshot is great to know about :D

    anyway onto the update I need to backup my Dovecot/Postfix mailserver and I am strugging to work out what it is precisely that I need to backup (Existing backup script below)
    What I am aiming for is that in the event the server goes down I can quickly restore to different hardware (or VPS) I am expecting to have to pre-install dovecot and postfix, but would it be possible to backup the existing users, aliases etc (I am using linux users)

    tar -cvpzf /backup/"$(date '+%y-%m-%d')my.hostname.domain.tar.gz" --exclude=/backup/* --one-file-system / > /backup/$(date '+%y-%m-%d')backuplog.txt

    Thank you very much

    DT27
     
  4. deathtaker27

    deathtaker27 Modder

    Joined:
    17 Apr 2010
    Posts:
    2,238
    Likes Received:
    186
    bump any ideas anyone?
     
  5. Zoon

    Zoon Hunting Wabbits since the 80s

    Joined:
    12 Mar 2001
    Posts:
    5,869
    Likes Received:
    809
    For postfix at least:

    /etc/passwd for a list of users
    /etc/postfix/*
    /home/*/Mailbox (if that's where you are putting the mail)

    Don't use dovecot so not sure what that needs.

    For general system backups, /etc and all subfolders is a good idea.

    I dunno what operating system you're using but a list from your package manager of all installed packages is probably a good idea.

    If you're use a redhat base then:

    yum grouplist | grep installed > ~/installed-groups.txt
    yum list installed > ~/installed-packages.txt
     
  6. phuzz

    phuzz This is a title

    Joined:
    28 May 2004
    Posts:
    1,712
    Likes Received:
    27
    and /home

    *edit duh zoon already mentioned that
     
  7. dinoscothern

    dinoscothern Minimodder

    Joined:
    16 Aug 2010
    Posts:
    132
    Likes Received:
    0

    Rsnapshot is a implementation of the above idea. It works reasonably well, though for some reason it uses tabs instead of spaces for parts of the config.

    The only problem with the incremental rsync approach is that the files are not compressed.

    An interesting number of alternatives are given in https://wiki.archlinux.org/index.php/Backup_programs

    I've tried a few but they all seem to be compromises. Thats life I guess.
     
  8. deathtaker27

    deathtaker27 Modder

    Joined:
    17 Apr 2010
    Posts:
    2,238
    Likes Received:
    186
    Thank you guys,

    How would I be able to restore my user accounts or would it be easier to re-create them and just set the permissions on the folders again?

    Note: I have about 8 -10 users, I do know all the passwords.
     
  9. Gareth Halfacree

    Gareth Halfacree WIIGII! Lover of bit-tech Administrator Super Moderator Moderator

    Joined:
    4 Dec 2007
    Posts:
    17,090
    Likes Received:
    6,639
    They are if you use compression at a file system level. All my backups go to compressed btrfs volumes. (Plus, naturally, the incremental nature of the backup and use of hardlinks means that you're only storing changed data between backups, further reducing storage requirements.)
    Do you mean Linux user accounts? Just restore /etc/passwd, /etc/group, and /etc/shadow and you should be good to go.
     
  10. dinoscothern

    dinoscothern Minimodder

    Joined:
    16 Aug 2010
    Posts:
    132
    Likes Received:
    0
    Btrfs is a still in Technology Preview on RedHat, so I'm a bit leery of using it. Unfortunately enterprise ready scalable compressed filesystems are a bit thin on the ground atm, so I might give it a go.
     
  11. Gareth Halfacree

    Gareth Halfacree WIIGII! Lover of bit-tech Administrator Super Moderator Moderator

    Joined:
    4 Dec 2007
    Posts:
    17,090
    Likes Received:
    6,639
    ZFS? Lot more enterprisey than btrfs, with the added bonus of online block-level deduplication (if you've got the RAM) to further drive down storage requirements.
     
  12. dinoscothern

    dinoscothern Minimodder

    Joined:
    16 Aug 2010
    Posts:
    132
    Likes Received:
    0
    Ah ZFS, I'd forgotten about that one. It unfortunately has non technical 'issues', its not in the kernel because of GPL incompatibilities so I'd have to use FUSE or I could use Oracle Linux. At work thats not practical, but I could use it at home, so thanks for mentioning it.
     
  13. Gareth Halfacree

    Gareth Halfacree WIIGII! Lover of bit-tech Administrator Super Moderator Moderator

    Joined:
    4 Dec 2007
    Posts:
    17,090
    Likes Received:
    6,639
    Not so: there's been a native ZFS on Linux port since 2013.
     
  14. dinoscothern

    dinoscothern Minimodder

    Joined:
    16 Aug 2010
    Posts:
    132
    Likes Received:
    0
    Interesting, it is separately packaged because it can't be shipped with the kernel, and looks like it uses DKMS on redhat/centos so shouldn't kernel panic when the kernel is updated. It should work fine for a backup volume, nice :)
     
  15. deathtaker27

    deathtaker27 Modder

    Joined:
    17 Apr 2010
    Posts:
    2,238
    Likes Received:
    186
    Thank you guys, have this working now and a test restore has worked first time :D
     

Share This Page