Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I switched a few weeks ago from a dedicated server to a VPS. Now that everything is working well on the VPS I would like to shutdown the dedicated server and close my account with the hosting company.

For peace of mind and in order to be more safe I would like to do a full backup of the server before stopping it.

The best would be a backup that I could browse if I find that I need a something in the backup.

What would be the best solution from command line?

Update :

Medium : Network

share|improve this question

3 Answers 3

up vote 12 down vote accepted

The best tool to use for this is probably dump, which is a standard linux tool and will give you the whole filesystem. I would do something like this:

/sbin/dump -0uan -f - / | gzip -2 | ssh -c blowfish user@backupserver.example.com dd of=/backup/server-full-backup-`date '+%d-%B-%Y'`.dump.gz

This will do a file system dump of / (make sure you don't need to dump any other mounts!), compress it with gzip and ssh it to a remote server (backupserver.example.com), storing it in /backup/. If you later need to browse the backup you use restore:

restore -i

Another option, if you don't have access to dump is to use tar and do something like

tar -zcvpf /backup/full-backup-`date '+%d-%B-%Y'`.tar.gz --directory / --exclude=mnt --exclude=proc --exclude=tmp .

But tar does not handle changes in the file system as well.

share|improve this answer
    
this dump command takes care of installed programs also right? like nginx, etc.. –  Thale Dec 23 '13 at 8:47

have you heard of Bacula?

Bacula is a set of Open Source, enterprise ready, computer programs that permit you (or the system administrator) to manage backup, recovery, and verification of computer data across a network of computers of different kinds. Bacula is relatively easy to use and efficient, while offering many advanced storage management features that make it easy to find and recover lost or damaged files. In technical terms, it is an Open Source, enterprise ready, network based backup program.

share|improve this answer

What medium are you going to be storing the backup on? If you're backing up over the network I would sshfs/nfs mount my destination on the source server and run something like:

tar cvjf /<remote_mnt>/<point>/source-030810-full.tar.bz2 /* --exclude=/proc --exclude=/dev --exclude=/sys --exclude=/tmp --exclude=/<remote_mnt>

Note that has not been tested, just my general thinking you may want to exclude more or less than that.

share|improve this answer

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.