Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

We have a common Samba Server for all the departments. However we are not taking any backup of this server in other location. Recently this leads a lot of data corruption. And we are unable to restore any those datas. I just want to take a step forward to avoid this problem in future. Is there a way to backup files which is in samba server to other location using rsync (incremental backup) ? Pls someone explain it with an example in detail. Thanks in advance.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

The basic rsync command to backup the whole filesystem of a server is:

rsync -av --delete --numeric-ids \
    --exclude="/proc/*" \
    --exclude="/sys/*" \
    --exclude="/DIRECTORY/" \
    root@server:/ /backup/directory/

Strongly recommended: first run rsync with -n option to simulate the transfer, so that you can add specific exclude rules (and check that the --delete is not removing wrong files).

You need ssh running on the server you want to backup. You may need to add a SSH key to your server, and put the rsync command in a shell script, run by cron to do nightly backups or so.

man rsync is a very comprehensive documentation.

share|improve this answer
add comment

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.