0

I'm copying files from my workstation to a dev sandbox, locally I don't have the www-data user, which is needed by my web server.

Is there a way to set up an user_id for files synced by unison?

astropanic
  • 307
  • 2
  • 5
  • 18

2 Answers2

0

Much depends on how you use unison and on which operating system(s) it operates. Next time (next question), please include any information to understand the exact situation, that gives you trouble.

Anyway - some ideas for you:

  • There are flags 'group', 'owner' and 'numericid', which controll the propagation of these properties to your target
  • As you mention, that you don't have the www-data user, you just might add it to your system.
  • You might arrange for unison using (running as) user www-data on the target system, then it would be difficult, not to have www-data as owner on the target system (sandbox), at least for files newly created there by unison.
  • You might ask yourself, wether you need www-data ownership of your target files; user www-data makes me think of a web server, and most of the time it is enought for the webserver to be able to read or sometimes execute the files. This can be arranged by setting group or others permissions adequately (chmod 644 or chmod 755 for read or read-and-execute).
TomTomTom
  • 611
  • 3
  • 6
0

Add www-data to your user's group.

When I stumbled across this question, what I did is to add the www-data user to my user's group (ie john:john) and www-data, being in the john group allowed me to use permissions like 775 (directories) and 664 in certain places.

NOTE: most places it's still fine to only give www-data read-only access. In this case that would be the 755 (directories) and the 644 (files).