cron: different permissions than running in terminal

kimtorgersen

Cadet
Joined
Mar 20, 2020
Messages
1
Was hard searching and setting a good title describing the problem. Trying to do a really simple task.
Problem started after upgrading from 11.2 to 11.3.

1. I have a script in the user's "me" home. "script.sh" (rwxr-xr-x)
2. The user "me" is a member of the group staff.
3. The first command in the script runs a ls command on a folder with the permissions: rwxr-x---, "other user":staff

My script works when logged in via ssh with the user "me" and running the script by typing "./script.sh".
When the cron-job runs the same command, i get a email with the error: "ls: <path to staff-owned folder>/backup*.pg: Permission denied".

Tested setting up a cron-job with the command "id > test". The file test was created, but empty. Running the command id in terminal shows the user "me" being a member of the group staff.

Don't know how to continue troubleshooting. Thanks in advance!
 
Top