0
votes

I have a simple bash script and it works fine when I execute it directly (bash testfile.sh). But when I use it in crontab, it is not working..

*/10 * * * * cd /var/trafficviewer/script; ./testfile.sh

I made the chmod +x testfile.sh as well.In error log, I could found below error..

Jul 12 16:45:01 XX crond[1439]: (cd) ERROR (getpwnam() failed - user unknown)

Can someone help me on this error?

Note: I dont have root access for this server. I installed these crons by using sudo commands.

Is there a user named cd on your system? - stark
@stark no.. I used that to run the script... svradmin is a user - Codec737
then why are you putting cd where the user name goes? - stark
@stark I have used this same command for one of my some servers. Thats why.. - Codec737
*/10 * * * * svradmin /var/trafficviewer/script; ./testfile.sh will resolve the issue? - Codec737