Perl Monk, Perl Meditation | |
PerlMonks |
How do I allow my test script to get rsync to archive file ownership?by nysus (Parson) |
on Jan 22, 2018 at 17:16 UTC ( [id://1207687]=perlquestion: print w/replies, xml ) | Need Help?? |
nysus has asked for the wisdom of the Perl Monks concerning the following question: OK, I've been struggling with this for a while now and getting no where. I've got a test script t/test.t. My test script loads a Moose object that has a wrapper for Net::OpenSSH which I use to create an rsync archive from a remote server to my local server. I set up Vim so that when I hit <F7>, it will call a custom script I have called run_tests.sh which executes my test script with the prove command and displays the test results in a separate tmux pane. It all works great. The problem is that since my test script is run under my local user account, it does not have the proper permission to change the uid/gid of the downloaded files. I tried to fix this by editing my bash script to run sudo -HE prove ... with the -HE options to to try to preserve my local user's environment so the root user would still have access to my PERL5LIB path. But it didn't work. I still get the Can't locate Blah.pm in @INC error. Apparently, sudo strips out the PERL5LIB path out for security reasons. The other thing I struggle with is I want to avoid typing in my password every time I run my test. Typing in my password dozens of times is not my idea of fun. Is there a way to securely give my script the ability to change permissions on the downloaded files (and preferably without the need to enter my password)?
$PM = "Perl Monk's";
Back to
Seekers of Perl Wisdom
|
|