I have a server with a user named deploy-user
and have written a backup script to backup a number of websites associated with this user. However one of the sites I'm trying to backup has a directory /home/usera/web/www.example.com/some/random_dir
is owned by apache-data-user
.
What permissions would I give deploy-user
to be able to backup that directory. Options I am aware of are either:
- Running the script as
root
, which I don't really want to do. - Adding
apache-data-user
anddeploy-user
to the same group. But thenapache-data-user
will have to many permissions.
Has anyone got a suggestion of the best way to backup this directory?