0

I just got a new backup device, and I wanted to start using it with rsync, so I back things up, and the system decides to completely not boot at all. (Here's that question: link)

But I solved that problem by omitting the /var directory, but I need to backup things in /var like the www/ directory and other things. How would I go about doing that?

Here's my current rsync code:

rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/BTSync","/home/cloud7/torrent"} / /mnt/backup/cloud7
1
  • Why the downvotes, people? It seems a perfectly reasonable question to ask, even if it does appear to be a strange situation. Commented Sep 26, 2016 at 8:55

2 Answers 2

1

I fixed it myself, I excluded /var/run (which was a link to /run) and /var/lock (same deal).

4
  • Do you know why tickling these directories should cause your system to fail to boot? Is it a causal relationship or just coincidence? Commented Sep 26, 2016 at 8:56
  • Because the system is constantly accessing these files, and with rsync, its possible that upon reading a file that something else is writing to, the file could get corrupted. Commented Sep 27, 2016 at 9:11
  • There's no way that reading a file will corrupt it. And Linux systems don't mandate reader/writer locks so the act of reading won't prevent writing. You might get a corrupted backup for rsync if the file is being update at the instant the read is happening, but that wouldn't cause a boot failure. Hence my curiousity to understand what's going on. Commented Sep 27, 2016 at 9:36
  • I know it's strange, but a few sources actually say this. I also kept getting this email when I ran commands on the system after rsync backup: cloud7-media : Sep 25 21:43:31 : cloud7 : unable to open /var/lib/sudo/cloud7/3 : Read-only file system ; TTY=pts/3 ; PWD=/home/cloud7 ; USER=root ; COMMAND=smartctl -A /dev/sdc Commented Sep 27, 2016 at 11:57
1

Rather than exclude specific paths, exclude mount points. It doesn't make sense to back up non-stored filesystems such as tmpfs (used for /tmp, /dev, /var/run, etc. on most modern systems), procfs, sysfs, etc. This also excludes external media.

rsync -aAX -x -v --exclude={/lost+found,/BTSync,/home/cloud7/torrent} / /mnt/backup/cloud7

If your system has multiple partitions, you'll need to back them all up. For example, if /home is a separate partition:

rsync -aAX -x -v --exclude={/lost+found,/BTSync,/home/cloud7/torrent} / /mnt/backup/cloud7/
rsync -aAX -x -v --exclude={/lost+found,/BTSync,/home/cloud7/torrent} /home/ /mnt/backup/cloud7/home/

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.