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.

This is my cron task for rsync

00 03 * * * /usr/bin/rsync --delete -aAXv /* /media/mirror --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/home/*/.gvfs} && /bin/date | /bin/cat > /home/william/ubuntu-server-backup/last_rsync.txt

This is in root's crontab. The destination drive ( mirror) has the same capacity as the main disk.

I verified, and the symbolic links are still links, they have not been copied twice.

What am I doing wrong?

EDIT: I just checked, and it looks like ''/media'' is not excluded. why? I got my command from the Arch Wiki.

share|improve this question
    
That is a very weird exclude syntax. I'd recommend using an exclude list text file with --exclude-from, or multiple --excludes for each directory. Also try adding the --delete-exclude option. –  izx Sep 27 '12 at 8:26

3 Answers 3

Looking at your rsync-call, a few things come to my mind immediately:

  1. You most likely want to avoid splitting hard links on the originating file system into separate (duplicate) files on your copy. Add -H to your rsync options to avoid that.
  2. Your command adresses each subdirectory of / separately, and syncs it to the target directory, effectively joining a system that may reside on separate partitions into one big partition. (if your /home is on a separate partitoin by design, on your backup it will be stuffed into the same partition as everything else. In any case, should you ever need to boot from that backup, you will need to adapt the fstab on the copy.
  3. Possible recursion: If your exclude pattern fails, you will sync /media/mirror into itself, creating /media/mirror/media/mirror/..
  4. You probably want to replicate the original filesysten 1:1 in the copy. Since according to your call it's also your currently active root file system, it will be very much alive and being written to. Preferably you would boot from another filesystem (be it from net, alternate root partition, live-CD, USB stick, whatever works for you) in order to replicate a quiescent file system.
share|improve this answer

It seems to be a bug according to https://bugzilla.samba.org/

see this

share|improve this answer

I was having similar issues:

To solve I added to rsync

--exclude-from "/home/<username>/exclude.txt"

Where exclude.txt was :

 /dev/*
 /proc/*
 /sys/*
 /tmp/*
 /run/*
 /mnt/*
 /media/*
 /lost+found
 /home/*/.thumbnails/*
 /home/*/.cache/mozilla/*
 /home/*/.cache/chromium/*
 /home/*/.local/share/Trash/*

Finally before the actual backup I removed from the destination all the directories such as /proc that were created before I properly set up the exclusion rule.

Also the official guide was quite helpful.

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.