You are not logged in.

#1 2015-06-03 22:09:13

dejy
Member
Registered: 2014-03-18
Posts: 67

What directories to exclude from Rsync when moving /root partition

I'm moving my /root and /home partitions to a new partition left of their current locations on the drive. So far I have:

#!/bin/bash
#dry-run
rsync -avxognHXW --no-compress --progress --numeric-ids \
  / /media/new/ \
  --exclude=/media/* \
  --exclude=/mnt/* \
  --exclude=cache \
  --exclude=/home/*/.cache \

I know there are also locks and files in proc I want to exclude, but I don't have a comprehensive list. Will I be polluting the relocated installation if I miss these?

Offline

#2 2015-06-03 22:19:24

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: What directories to exclude from Rsync when moving /root partition

Offline

#3 2015-06-03 22:25:50

dejy
Member
Registered: 2014-03-18
Posts: 67

Re: What directories to exclude from Rsync when moving /root partition

lucke wrote:

I looked at that, I wasn't sure whether the backup did not exclude things that would be necessary on relocation.

Last edited by dejy (2015-06-03 22:26:08)

Offline

#4 2015-06-03 22:27:06

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: What directories to exclude from Rsync when moving /root partition

You don't need the contents of /dev, /proc, /sys, /run and /tmp.

Offline

#5 2015-06-04 00:19:03

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 682

Re: What directories to exclude from Rsync when moving /root partition

lucke wrote:

You don't need the contents of /dev, /proc, /sys, /run and /tmp.

He's already specified "-x" so rsync won't copy those anyhow. For that reason /mnt/* and /media/* are also excluded so don't really need to be explicitly excluded.

Offline

#6 2015-06-13 18:09:03

WFV
Member
From: ☭USSA⛧⭒⭒⭒⭒
Registered: 2013-04-23
Posts: 288

Re: What directories to exclude from Rsync when moving /root partition

for root

rsync -aAXhv --exclude={/dev/*,/home/*,/media/*,/mnt/*,/proc/*,/run/*,/sys/*,/tmp/*,/var/lib/pacman/*,/lost+found} /<path to new location> 

you might want to include /var/lib/pacman, the first half (input) of this rsync is part of an incremental system backup I use for local rollback

Last edited by WFV (2015-06-13 18:12:50)


∞ hard times make the strong, the strong make good times, good times make the weak, the weak make hard times ∞

Offline

#7 2015-06-13 23:42:08

grandtheftjiujitsu
Member
Registered: 2013-07-27
Posts: 91

Re: What directories to exclude from Rsync when moving /root partition

It may be helpful to read about the Arch filesystem hierarchy and which directories are populated on boot and those that are essential for booting or otherwise warranting of a backup.

Depending on how pinched you are for storage space you can also read here which is a method I've used when doing a minimal backing up to a thumb drive.

Offline

#8 2015-06-20 10:17:37

dejy
Member
Registered: 2014-03-18
Posts: 67

Re: What directories to exclude from Rsync when moving /root partition

WFV wrote:

for root

rsync -aAXhv --exclude={/dev/*,/home/*,/media/*,/mnt/*,/proc/*,/run/*,/sys/*,/tmp/*,/var/lib/pacman/*,/lost+found} /<path to new location> 

you might want to include /var/lib/pacman, the first half (input) of this rsync is part of an incremental system backup I use for local rollback

The poster above you is correct and I don't know why the wiki has this the --exclude is redundant with -X for the flag.

Offline

Board footer

Powered by FluxBB