Thanks for the suggestions! I tried the suggestion of MensaWater in 2 variations and a slight modification to limit to specific file names.
1. the target passed the test
Code:
sudo mv /home/user2/incoming/Asset_07* /home/user2/incoming/archive/../../../
[sudo] password for user1:
Sorry, user user1 is not allowed to execute '/bin/mv /home/user2/incoming/Asset_07* /home/user2/incoming/archive/../../../' as root on servername.
2. the source passed the test, I really didn't suspect this but thought I'd give it a shot.
Code:
sudo mv /home/user2/incoming/../../../archive/Asset_07072019.csv /home/user2/incoming/
[sudo] password for user1:
Sorry, user user1 is not allowed to execute '/bin/mv /home/user2/incoming/../../../archive/Asset_07072019.csv /home/user2/incoming/' as root on server.
I also limited the naming convention to a very specific structure and tested that successfully.
Code:
sudo mv /home/user2/incoming/test.test /home/user2/incoming/archive/
[sudo] password for user1:
Sorry, user user1 is not allowed to execute '/bin/mv /home/user2/incoming/test.test /home/user2/incoming/archive/' as root on server.
So, the sudo rule is a follows:
user1 ALL=(ALL) NOPASSWD: /bin/mv /home/user2/incoming/Asset_* /home/user2/incoming/archive/
@pan64 the script would be ideal, but this is a fluid environment at the moment, however I may leverage a script(s) if it becomes more complex.
Thoughts?