0

I have an issue where I get the following error when trying to download apache logs:

rsync: send_files failed to open "/var/log/apache2/log-filename": Permission denied (13)

The command I'm running is:

+/usr/bin/rsync -avz -e 'ssh -i /home/weblogs/.ssh/id_logaccess_rsa' 'logaccess@servername:/var/log/apache2/logname*.gz' /home/weblogs/logs/serverdirectory

(I've censored company information with things like 'serverdirectory, log-filename, servername etc)

When looking at the logs themselves, it looks like the issue started when the root user randomly switched groups, it seems to switch from primary to adm exactly when the permission issue started. The group switch seems to have made the logaccess user to lose access to logs.

Any ideas?

I'm running an ubuntu box with apache 2.

0

Are you using logrotate? Adm Is the group usually assigned by the log rotate daemon.

See http://linuxers.org/howto/howto-use-logrotate-manage-log-files

  • yes I believe it is. I didn't set up the server but logrotate is configured as per the link you sent me. – tipyn Jun 18 '14 at 3:58
0

Turns out someone had actively gone and changed the logrotate configuration file to the adm group rather than the primary group. Therefore breaking the permissions for logaccess.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.