I have a cron job, which is running under a user called 'deployer' with limited access. The cron job is performing a backup of my redis database resulting in a dum /var/lib/redis/dump.rdb.
Now the cron job now tries to perform a /bin/gzip -c /var/lib/redis/dump.rdb > /home/deployer/Backup/.tmp/redis_backup/databases/Redis/dump.rdb.gz
before shipping it off to S3. The problem is, that the permissions on /var/lib/redis/dump.rdb is -rw-rw----, so I get the following error:
gzip: /var/lib/redis/dump.rdb: Permission denied
So my question is, I'm not interested in giving my deployer user wider permissions, so I would like that dump, that is being created every time the cron job is run, to have other permissions.
How can I accomplish that the simplest way?