It copies 5022 files, totalling 109.2Mb, and even though both machines have NVME SSDs and the network is quiet,
the task takes over 30 minutes! Note - some of the files are owned by root, and have "600" permissions, which need to be preserved.
How do I go about this in a secure way?
I was thinking of setting up passwordless keyfile access for root, and then using command: sudo rsync, delegated to localhost, and tearing root access down again afterwards. How would I do this using Ansible?
Your idea triggered the best solution I have found. Thanks.
This is my solution - for people who discover this later.
io.hcs holds the backup we are trying to restore.
sinope.hcs is where we are restoring to.
callisto.hcs is where ansible is run.
There is a (read only) samba share on io.hcs that is permanently open on callisto.hcs, but can't be used to copy the files over, because the permissions get altered. But it can be used to copy the archive over. tar maintains ownership and permissions as default behaviour.
Therefore the tasks are:
- name: get IO to tar up the website
community.general.archive:
path: "/home/ian/BackupFiles/hobson42/var/www/ianhobson.com/"
dest: /home/ian/BackupFiles/ianhobson.com.gz # will appear in share as /home/ian/backup/ianhobson.com.gz
delegate_to: io.hcs
Result is a speed up of between 60 and 100 times!
The files are restored with the correct permissions and ownership. I think it is necessary that all users are set up on all machines with the same user numbers in /etc/passwd.
Your idea triggered the best solution I have found. Thanks.
This is my solution - for people who discover this later.
io.hcs holds the backup we are trying to restore.
sinope.hcs is where we are restoring to.
callisto.hcs is where ansible is run.
There is a (read only) samba share on io.hcs that is permanently open on callisto.hcs, but can't be used to copy the files over, because the permissions get altered. But it can be used to copy the archive over. tar maintains ownership and permissions as default behaviour.
Therefore the tasks are:
- name: get IO to tar up the website
community.general.archive:
path: "/home/ian/BackupFiles/hobson42/var/www/ianhobson.com/"
dest: /home/ian/BackupFiles/ianhobson.com.gz # will appear in share as /home/ian/backup/ianhobson.com.gz
delegate_to: io.hcs
Result is a speed up of between 60 and 100 times!
The files are restored with the correct permissions and ownership. I think it is necessary that all users are set up on all machines with the same user numbers in /etc/passwd.