g0rd0 Posted May 20, 2005 Posted May 20, 2005 how can I run a bash script from a cron job? when I try to run a script I have for automating backups on other linux machines I get the following error from cron: /bin/sh: /home/path-to-my-files/backup.sh: /bin/sh : bad interpreter: No such file or directory /bin/sh is telling me the /bin/sh does not exist? does anyone understand that? Thanks in advance Gordon~ Quote
TCH-Andy Posted May 20, 2005 Posted May 20, 2005 Hi Gordon, Welcome to the forums Try just "/home/path-to-my-files/backup.sh" and you will need to ensure that the path /bin/sh is in the top of the shell file, and that the permissions are set correctly on the file to execute. Quote
borfast Posted May 20, 2005 Posted May 20, 2005 Welcome to the forum, Gordon! You may also want to try adding "sh " in front of the command Andy suggested, in case the file you're trying to execute doesn't have execution permissions. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.