Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

Your Answer


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.