Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have VPS hosting with debian operating system.

I would like to backup whole system time by time.

Here is a lot of questions how to backup OS on local machine, but it's not what I need. I have just ssh and superuser account.

share|improve this question
1  
File backup or image backup? With a file backup you cannot do a full restore without an already working operating system, but ideal for restoring one or more lost/corrupted files; With an image backup, each backup set is huge, but comes with the advantage that a complete system can be recovered to the state it was in at the time of the backup. Restoring a single file from an image is nearly impossible. –  jippie Dec 25 '12 at 22:29
    
What retention time? Do you want off site storage? Tapes? Disks? –  jippie Dec 25 '12 at 22:31
    
Sorry, I mean image backup. I installed OS, different application and I can do smth to brake it accidentally. For these cases I would like to save all settings. And I think to save image backup - it's a good way. –  Anthony Dec 25 '12 at 23:07
1  
Creating images is very slow as you generally copy the entire harddisk, regardless of what's on it. Usually the system has to go down and booted from a different medium. Perhaps easiest for you is to create an image once in a while and combine that with regular file backups. Best of both worlds. –  jippie Dec 25 '12 at 23:21
    
It doesn't matter whether the machine is local or not. –  psusi Dec 26 '12 at 2:46

3 Answers 3

up vote 1 down vote accepted

If you need to backup just the system configuration (which at the end of the day usually is about third of the content of a system), all you should need is a list of packages installed + their configuration. The list of installed packages you can get with your packaging utility, the system-wide configuration lives in /etc (in /usr/local/etc and /opt/<vendor>/etc if you have some really non-standard stuff installed) and you might also want to throw in /root. Hence you can just backup the configuration directories and the list of installed packages and you should have everything needed (for the first third).

The other two thirds would be:

  • private user data (home directories), and

  • public user data: data accessed by various services running on the system - usually mail queues, data served by http daemon. In some sense virtual machines or change-roots could fall into this category as well.

Regarding the system-wide back-up, apart from options mentioned in the other answers, if your installation (be it a virtualised guest or the VPS host) lives on a separate filesystem, you can either use the filesystem's native backup/snapshot capability (e.g. XFS has this feature) or mount it read-only and dump its containing device (which might be dangerous though). Plain ssh would be more enough to do this.

As with any other low-level system operation, running any the operation in terminal multiplexer, which protects the backup process from possible connection drops, and having a spare ssh connection (preferably served by a different process) is recommendable.

share|improve this answer

I'm using rsync for file backup. In the /etc/cron.daily put a script like:

EXCLUDES=/etc/rsync/excludes.txt
TARGETDIR=root@::backup-target
BACKUPDIR=/`date +%Y%m%d-%H%M%S`
export RSYNC_PASSWORD="veryverysecret"

rsync --force --ignore-errors --delete-excluded --exclude-from=${EXCLUDES} --delete --backup --backup-dir=${BACKUPDIR} -a -H -X -A / ${TARGETDIR}/current

Of course you have to configure the host-where-to-store-backup. Have a look in the rsyncd.conf man page.

share|improve this answer

I personally use Dirvish.org It is a disk based file backup that uses rsync over ssh and it is in Ubuntu repositories (so quite likely in Debian's too).

It is easy to configure, does incremental backups to disk, uses encryption to communicate accross the network, expiring old images is simple, only copies changed files, ...

share|improve this answer
    
Thx! Will try it –  Anthony Dec 25 '12 at 23:08
    
In contrast to your comment above, dirvish is file backup, it doesn't do full disk images. Dirvish is very good to do daily backup of all changed files. It is really fast and economic though for that. –  jippie Dec 25 '12 at 23:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.