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
Craig
  • 141
  • 1
  • 1
  • 10
  • 2
    Try specifying the rull path to `tar` and `date` in the script. Have you given the script execute permissions? – glenn jackman Sep 09 '15 at 19:22
  • Do you get anything in your cron logs? – Jesse K Sep 09 '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 09 '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

1 Answers1

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.

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300