The examples I sent up were testing. I'm actually doing it between my two i boxes on the same subnet so it's pretty isolated. And we don't have an extra authorities added to our stuff. We try to keep it plain vanilla as much as we can. The more complicated you make it the harder it is to diagnose when there are problems.
Original Message:
Sent: Fri October 04, 2024 03:48 PM
From: Korinne Adler
Subject: Getting ifs file ownership and permission settings right with rsync
Glad you found the --super
flag, which is the answer here.
rsync is designed around Unix limitations, so it will only respect the --user
flag if rsync is running as the "super user". Traditionally, this means you are running as UID 0 (root in Unix, QSECOFR on IBM i). You can bypass this internal check by adding the --super
flag. Linux has the same problem and --archive
doesn't help as it's just an alias for a bunch of options.
Note that as Marius mentioned, rsync currently can only save basic owner and group ownership and associated permissions. If you have any extra authorities added via CHGAUT, these will not be saved.
As for scp, I wouldn't consider it any more secure than rsync. Both use SSH under the covers and can take advantage of SSH's key-based authentication, however scp cannot preserve ownership information (only file mode and access/modified times). Also, I don't know if it is in any way useful in this case, since as far as I can tell from the example commands in the original post, this is all happening on the same system with no remote access at all.
------------------------------
Kevin Adler
Original Message:
Sent: Tue October 01, 2024 05:22 PM
From: Montie Southern
Subject: Getting ifs file ownership and permission settings right with rsync
I want to use rsync for some ifs replication/backup stuff. I've got it running fine but for some reason when I do the rsync the file ownership and permission settings are not being synchronized. Files come over to the new ifs directory well. But they show to be under the ownership of the user profile logged in to the ssh session where the rsync command was run. Use this a lot on my Linux boxes but have never run into an issue like this. For testing I am just doing a local ifs dir to another local ifs dir with no luck. So I know the profiles exist because they are already used on the source dir. Just wanted to get this working before trying across boxes which is my ultimate goal.
Has anybody else run into anything like this using rsync on an i?
IBM i V7R4
rsync OSP is 3.2.3-5
Here's the syntax for two different ways I've been rsync'ing this.
rsync --archive --stats --verbose /sourcedir/ /targetdir/
rsync --archive --stats --verbose --owner --group --perms /sourcedir/ /targetdir/
------------------------------
Montie Southern
------------------------------