SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I would like to use rsync -a to backup large volumes on a distributed server cluster. The specific problem I am having is the saving of permissions, owners and groups of files, so that I can restore them without change.
Specifically, my cluster consists of different Slackware systems (15 and 14.2), which are for the most part a collection of disc drives.
I would like to run rsync, backing up from one machine, and storing the backup file structure on another machine, via NFS. Ideally, the backup tree could be partially or completely be restored if needed.
To maintain integrity in this arrangement, I would like to do the file backup and potentially restores, as root.
Running as root, this preserves file permissions and ownership. Ideally, you run this from the destination side, because some special permissions can't be written over nfs I think.
It actually is possible to run as a normal user, but of course this will be restricted to the files that the user can access, and it will not preserve ownership.
@IsaacKuo, how would you restore from that, and maintain permissions? Assuming that you are restoring from the backup system drive, it would appear to have a problem with root permissions.
In my instance, all systems are running YP/NIS, so the users and groups are the same. But restoring to a root owner seems to be an issue.
I prefer to use real backup solutions for backups, but when I use rsync I never mix it with any remote mount utility.
Rsync does fine syncronization without NFS.
The reason for some of the options is although the script normally is automated, sometimes I perform backups manually and I like monitoring the progress and status.
The backup server is configured with rsnapshot, a perl script wrapper to rsync. Those backups pull files hourly from other systems, mostly /boot, /etc, /home, /root, /var. I use:
To maintain integrity in this arrangement, I would like to do the file backup and potentially restores, as root.
I might be reading too much into the statement, but seems you might be hesitant about elevating privileges. Everything in my backup strategy is automated to run with the root user with the cron and at schedulers. All system ownership and permissions are preserved. The only way to preserve everything is with root privileges.
Quote:
Any guidance?
Regularly test restoring files. I test restoring files often and I have tested a worst case scenario of restoring everything to bare metal. A bare metal recovery requires some spare computers. Virtual machines can suffice, but actual hardware is better with exposing various driver issues because in a true disaster recovery likely the replacement hardware will be different from the damaged hardware.
You mention a mixed environment of 14.2 and 15.0 systems. I have a similar environment and also have virtual systems runner older Slackware releases as well as a mixture of 32-bit and 64-bit. That mixture helps create some robust scripts because every system is different. In particular, rysnc changed between 14.2 and 15.0 with new file list safety checks, which for me broke the rsnapshot backups. That is why I use the trust-sender option.
Another item to consider with a mixed 14.2/15.0 environment is keep everything configured to use nfsvers=3 in fstab.
Although three systems push backups, I prefer pulling files to a backup server. The reason is NFS export permissions on the backup server can be configured to read-only. This allows anyone on the LAN to access the backups, but if systems are compromised the malware would not be able to attack the backup files. I like rsnapshot because the basic design is to pull files rather than push.
There are variations, but perhaps look into the "3-2-1" strategy.
I hope that helps!
Last edited by lostintime; 01-22-2024 at 01:05 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.