1

I want to write a script that dumps my database and makes a backup of if. However I've faced a problem. I need to SAVE database and after that I need to copy a file to another location. The thing is, after I run a SAVE command with redis-cli, the file permissions are overwritten and set to -rw-rw----.

How to tell Redis to save the dump.rdb with another permissions?

I've found this answer: Changing default file permission on redis dump, it describes the same problem I'm facing, however setting umask didn't help in my case.

serge1peshcoff
  • 4,342
  • 11
  • 45
  • 76

1 Answers1

1

Answering my own question, thanks to the guys at Redis repository at Github.

Here's how I solved it:

sudo systemctl edit redis-server.service

In the editor, type; [Service] UMask=0002

And then run systemctl reenable redis-server.service and systemctl restart redis-server.

serge1peshcoff
  • 4,342
  • 11
  • 45
  • 76