It's a question on copying in Linux in general and not just Singularity. I'm trying to recursively copy from remote directory to local directory. In my definition file I have:
scp -r $USER@$HOST_MACHINE:/a/b/c ${SINGULARITY_ROOTFS}/a/b
The problem is that I need group abc
to be able to access /a/b/c
on $USER@$HOST_MACHINE
. I have this group but not in my active groups on the remote machine. I tried some variance of sg
but they all failed. For example:
sg abc scp -r $USER@$HOST_MACHINE:/a/b/c ${SINGULARITY_ROOTFS}/a/b
Fails because I have abc
only in $HOST_MACHINE
and not locally. I also tried to use ssh
but I need to copy to local directory and not on remote directory.
I was looking in the docs of rsync and scp but could not find a way to add a group into my active groups on remote machines, before copying. Basically I'm looking for a way to do:
scp -active_group abc -r $USER@$HOST_MACHINE:/a/b/c ${SINGULARITY_ROOTFS}/a/b
How can I copy files from remote to local with a special group?
Basically I could do the following steps:
- Ssh the remote machine.
- Wash or use the
sg
command. - Copy from remote to local.
- exit remote machine.
But the script should be automatic so it's breaks it. I also guess there is a way to do this and I'm just missing it.