I'm running a java tool as a command line app using cronjob:
java -jar /var/java/-myfile.jar
By default I'm using logback
and write to /var/log/mylogfile.log
.
Problem: the user running the jar has no permissions to write to the /var/log/
folder.
That folder has only permissions to `root syslog'.
Question: should I run the jar as sudo
? Or should I give the running user write permissions to that folder? If yes, how?
.jar
assudo
; every mistake (wrong paths e.g.) could destroy your system. Assyslog
has write access, you might add the user to that group:adduser <user> syslog
. – ridgy May 12 '17 at 8:31