2

I am using screen so that I can run a job and log out of the servers, as these jobs take few hours to run. One of the tasks of these jobs is to save information in a file. But whenever I log out of the servers and log back in, I get the error of permission denied. The jobs run fine, and save the information in a file, if I am logged in the entire time (which i prefer not to do). I was wondering why when I log out, the jobs don't have permission to write the files.

8
  • Does this happen with any command/file that you run or just a particular command or file? For example, does while true; do date >> /tmp/date.log; sleep 2; done also give you permission denied if you logout?
    – gogators
    Sep 23, 2015 at 21:08
  • I just checked. When a create a new screen session. I can make/delete folders. If I detach the screen then log out and log back in and then reattach the screen, then I don't have permission to make/delete/read files. I don't know why is that the case.
    – A Gore
    Sep 23, 2015 at 23:56
  • One possibility I can think of is if your home directory (or other filesystems) are dynamically mounted. Maybe when you log off, your home directory also gets unmounted and then you don't have permissions anymore on the underlying tree. Sep 24, 2015 at 23:48
  • @eldering Do you know what I can do to resolve the problem then?
    – A Gore
    Sep 25, 2015 at 11:45
  • Not sure, this would depend on how the system detects that you log in/out. You may try to write to a directory that is mounted regardless of whether you are logged in, maybe /tmp. Sep 25, 2015 at 13:45

0

You must log in to answer this question.

Browse other questions tagged .