1

How to set up a script to run as root non-interactively?

view story
linux-howto

http://unix.stackexchange.com – I need to set up the following script to run as root whenever I log in: #!/bin/zsh truncate -s 0 ~yourstruly/.juniper_networks/network_connect/ncsvc.log I know how to run the script as root interactively (namely through sudo), but I can't figure out how to make the script run as root non-interactively whenever I log in. How can I do this? FWIW: the script is currently owned by root, has permissions 6755, and the file to be truncated is also owned by root and has permissions 0644, but when I run the script, the call to truncate fails with a "Permission denied" error. (HowTos)