linux poison RSS
linux poison Email

How to run a crontab entry as "nobody"

Here's a quick example of how to run a program on a Linux system through a crontab entry, with the program being executed as the user nobody.

Just put this entry in a crontab file (by issuing the "crontab -e" command, for example), and the program named myProgram.sh will be run at 1:30 a.m. using the Bourne shell, and will be run as the user nobody.

30 1 * * * su -c '/path/to/program/myProgram.sh' -s /bin/sh nobody

Of course testing is always recommended, but this has worked for me.


0 comments:

Post a Comment

Related Posts with Thumbnails