0

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

#!/bin/bash

tar cvf reachdata_$(date +'%Y_%m_%d').tar /volume1/reachdata
4
  • 2
    Try specifying the rull path to tar and date in the script. Have you given the script execute permissions? Sep 9, 2015 at 19:22
  • Do you get anything in your cron logs?
    – Jesse K
    Sep 9, 2015 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) Sep 9, 2015 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, 2016 at 17:57

1 Answer 1

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .