Hello, I use for some years a rsync line in cron to make a backup from a server to an other server. btrfs on source, ext4 on target. Right now I have to be run from root on the receiving part # rsync -azv -e ssh -x --exclude=/tmp --exclude=*cache* --exclude=*.Trash* --exclude=/sys --exclude=/proc --exclude=/dev --delete root@<source domain>:/* <local folder> I checked that -x do *not* exclude /proc. But it may be also useful to exclude /run? isn't this one dynamic (ie removed at boot time). I don't remember also is proc, sys, dev a recreated at boot, no need to make them by hand at restore time? thanks jdd -- http://dodin.org http://valeriedodin.com
On 06/01/2022 11.31, jdd@dodin.org wrote:
Hello,
I use for some years a rsync line in cron to make a backup from a server to an other server. btrfs on source, ext4 on target.
Right now I have to be run from root on the receiving part
# rsync -azv -e ssh -x --exclude=/tmp --exclude=*cache* --exclude=*.Trash* --exclude=/sys --exclude=/proc --exclude=/dev --delete root@<source domain>:/* <local folder>
I checked that -x do *not* exclude /proc.
But it may be also useful to exclude /run? isn't this one dynamic (ie removed at boot time).
I don't remember also is proc, sys, dev a recreated at boot, no need to make them by hand at restore time?
/proc, /sys and /dev are indeed created at boot, you only need the mount points. You can confirm by rebooting to an external disk. /run is also dynamic. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
Thu, 6 Jan 2022 11:31:48 +0100 "jdd@dodin.org" <jdd@dodin.org>:
for some years rsync backup
This command line smells like a Restore was never required up to now? Restore is the entire purpose of doing backups. Add at least these options to rsync: --hard-links --acls --xattrs --numeric-ids --one-file-system Use just 'root@<source domain>:/', without trailing asterisk. Olaf
Le 06/01/2022 à 12:29, Olaf Hering a écrit :
Thu, 6 Jan 2022 11:31:48 +0100 "jdd@dodin.org" <jdd@dodin.org>:
for some years rsync backup
This command line smells like a Restore was never required up to now? Restore is the entire purpose of doing backups.
Add at least these options to rsync:
--hard-links --acls --xattrs --numeric-ids --one-file-system
Use just 'root@<source domain>:/', without trailing asterisk.
I don't want to keep all the path above, so the * for the other options, I not sure it's necessary. This command is aimed to remote servers, with neither screen nor keyboard. I already restored such server from the rescue system, but I try to avoid it because the operation is long, I'm unsure of what version of the commands are running in the rescue system... the use case that happened once to me is a complete failure of the internal disk. My provider changes the disk for free, but that's all, I have to rebuild the system. It's simpler to reinstall the very last version of openSUSE and restore from this all what is needed. Any way, One have to upgrade from time to time. so the backup is used as file source for data, config files... the hard links are created à install time if any (I never had to create one myself), I don't dare to touch at ACL's :-(. --one-file-system is used (it's -x) I can add than I don't know of any backup system really able to restart without problem. even raid is not. Better one is to use a virtual machine and backup it after stopping it. There are other ones, but too expensive for my use. on my post, my main concern was BTRFS on source. I don't (yet) had the time to double check btrfs backup :-( thanks jdd -- http://dodin.org http://valeriedodin.com
On 1/6/22 11:31, jdd@dodin.org wrote:
# rsync -azv -e ssh -x --exclude=/tmp --exclude=*cache* --exclude=*.Trash* --exclude=/sys --exclude=/proc --exclude=/dev --delete root@<source domain>:/* <local folder>
I checked that -x do *not* exclude /proc.
But it may be also useful to exclude /run? isn't this one dynamic (ie removed at boot time).
I don't remember also is proc, sys, dev a recreated at boot, no need to make them by hand at restore time?
you crrectly used -x: $ rsync --help | grep -F -- ' -x' --one-file-system, -x don't cross filesystem boundaries and as /proc, /sys and so on are mount points (see e.g. findmnt), you don't need to exclude them explicitly. Have a nice day, Berny
Le 07/01/2022 à 10:10, Bernhard Voelker a écrit :
you crrectly used -x:
yes
$ rsync --help | grep -F -- ' -x' --one-file-system, -x don't cross filesystem boundaries
and as /proc, /sys and so on are mount points (see e.g. findmnt), you don't need to exclude them explicitly.
but no, at least /proc is copied. rsync try to copy it (easy to see on screen) thanks jdd -- http://dodin.org http://valeriedodin.com
jdd@dodin.org wrote:
Le 07/01/2022 à 10:10, Bernhard Voelker a écrit :
you crrectly used -x:
yes
$ rsync --help | grep -F -- ' -x' --one-file-system, -x don't cross filesystem boundaries
and as /proc, /sys and so on are mount points (see e.g. findmnt), you don't need to exclude them explicitly.
but no, at least /proc is copied. rsync try to copy it (easy to see on screen)
This is because you include it explicitly: root@<source domain>:/* That will expand to include "/proc" I think this will work: root@<source domain>:/ -- Per Jessen, Zürich (3.5°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland.
Le 07/01/2022 à 11:22, Per Jessen a écrit :
jdd@dodin.org wrote:
but no, at least /proc is copied. rsync try to copy it (easy to see on screen)
This is because you include it explicitly:
root@<source domain>:/*
That will expand to include "/proc"
I think this will work:
root@<source domain>:/
may be -x placed elsewhere, because excluding it works I may have to re read the doc thanks jdd -- http://dodin.org http://valeriedodin.com
On 1/7/22 11:33, jdd@dodin.org wrote:
Le 07/01/2022 à 11:22, Per Jessen a écrit :
jdd@dodin.org wrote:
but no, at least /proc is copied. rsync try to copy it (easy to see on screen)
This is because you include it explicitly:
root@<source domain>:/*
That will expand to include "/proc"
I think this will work:
root@<source domain>:/
may be -x placed elsewhere, because excluding it works
I may have to re read the doc
no, as Per wrote, you included all directories explicitly with the /* wildcard. Just check what that would expand to, here it is: $ echo /* /bin /boot /data /dev /etc /home /lib /lib64 /lost+found /media /mnt /opt /proc \ /root /run /sbin /srv /sys /tmp /user /usr /var Just use / instead. Have a nice day, Berny
On 07/01/2022 10.10, Bernhard Voelker wrote:
On 1/6/22 11:31, jdd@dodin.org wrote:
# rsync -azv -e ssh -x --exclude=/tmp --exclude=*cache* --exclude=*.Trash* --exclude=/sys --exclude=/proc --exclude=/dev --delete root@<source domain>:/* <local folder>
I checked that -x do *not* exclude /proc.
But it may be also useful to exclude /run? isn't this one dynamic (ie removed at boot time).
I don't remember also is proc, sys, dev a recreated at boot, no need to make them by hand at restore time?
you crrectly used -x:
$ rsync --help | grep -F -- ' -x' --one-file-system, -x don't cross filesystem boundaries
and as /proc, /sys and so on are mount points (see e.g. findmnt), you don't need to exclude them explicitly.
But he uses *, so they are included, I understand. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
On 07/01/2022 12.36, Bernhard Voelker wrote:
On 1/7/22 11:47, Carlos E. R. wrote:
But he uses *, so they are included, I understand.
indeed, I missed that in the first reading.
Me too, I realized that today. And after posting I saw there were more mails in the queue, and some said the same. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
participants (5)
-
Bernhard Voelker
-
Carlos E. R.
-
jdd@dodin.org
-
Olaf Hering
-
Per Jessen