rsync a linux OS, excluding the non-desireable files

You can create a file to exclude all the patterns you need

# cat x.txt
/proc/*
/dev/*
/run/*
/tmp/*
/sys/*
/mnt/*lol
/media/*
/lost+found
/var/lib/origin/
/gbt/
/registry/
*log

Then just rsync
# rsync -rtva –progress / 10.156.197.10:/a/ –exclude-from x.txt

Leave a Reply

Your email address will not be published. Required fields are marked *