December 5, 201213 yr Can you help me with this. My goal is to create a script that will run yamj as nobody then add a cronjob that will run that scipt. The script will be named indexscript.sh I created a directory called my_extra to place the script in. Here is what I have tried #!/bin/bash sudo -u nobody /boot/extra/yamj-rescan.sh and su - nobody --shell=usr/bin/bash /boot/extra/yamj-rescan then I ran this command to establish the permissions chmod a+rwx /boot/my_extra/indexscript.sh Neither script worked when I tried to run it in a telnet session. Can you please look at it and tell me why the script will not work? Here is the what I am adding to my goscript: crontab -l > /tmp/file; echo '#Run Yamj-rescan at 1am every day' >> /tmp/file; echo '00 1 * * * /boot/my_extra/indexscript.sh >/dev/null 2>&1' >>/tmp/file; crontab /tmp/file; rm /tmp/file Thanks in advance for you time
December 10, 201213 yr Author Does amyone have any input? Since I moved to 5rc8 I found running yamj-rescan as root causes me issues, so I am looking to automate running yamj-rescan as nobody. I really appreciate any help provided getting this script working.
December 10, 201213 yr did you try to run the sudo command directly in your telnet session? do you see any errors? sudo -u nobody /boot/extra/yamj-rescan.sh should work, if the permissions of yamj-rescan.sh are correct. (the user nobody (or the group users) must have permission to read and execute it) try chmod 777 /boot/extra/yamj-rescan.sh
December 12, 201213 yr Author The only way I can run the following command: su - nobody --shell=usr/bin/bash hit "enter then run this command: /boot/extra/yamj-rescan yamj-rescan runs fine So my script reads like this: su - nobody --shell=usr/bin/bash /boot/extra/yamj-rescan Is my script missing anything?
Archived
This topic is now archived and is closed to further replies.