I have a script that works in the terminal perfectly, but for some reason won't fire off either in cron or when I run the script manually.

I don't know if it makes a difference, but it's running on an Asustor NAS device.

Here's the script


tar cvf reachdata_$(date +'%Y_%m_%d').tar /volume1/reachdata
  • 2
    Try specifying the rull path to tar and date in the script. Have you given the script execute permissions? – glenn jackman Sep 9 '15 at 19:22
  • Do you get anything in your cron logs? – Jesse K Sep 9 '15 at 20:37
  • Also try specifying the full path to the script in the crontab. And the obligatory dumb question - does the script run from a command prompt? (ofc, as the user you have it setup in cron for) – Brandon Xavier Sep 9 '15 at 23:24
  • NAS device uses a 'Linux-type' OS. That's why #!/bin/bash doesn't work - it doesn't exist. No fix still, but definitely found the problem. – Craig Mar 16 '16 at 17:57

If it's on an nfs server, you might want to check if the noexec option is included in the mount-options. That will prevent scripts such as that from executing. Alternately, ensure the script is marked as executable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.