For an application I want to store specific data on a data recovery server. On the application and DR server I created a user test1 and copied the public key from application server user test1 to DR user test1's authorized_keys file. User test1 is added to the wheel group.
I set permission on drwxr-xr-x /var/log
I then created a cron job to rsync the data from the application server to the DR server:
sudo rsync -avz -e "ssh -i /home/test1/.ssh/my-ssh-key" /var/nfsshare/ [email protected]:/var/nfsshare > /var/log/nfs_cron-$(date +\%m-\%d-\%Y).log
When the cron executes I get the following error:
/bin/sh: /var/log/nfs_cron-08-26-2019.log: Permission denied
However, when I try to create a file manually it creates the file successfully.
sudo touch /var/log/test.txt
which creates the file as:
-rwxr-xr-x. 1 test1 test1 0 Aug 26 12:28 test.txt
Any thoughts?
Thanks!