NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

davidr1's avatar
davidr1
Luminary
Apr 10, 2017
Solved

Script won't run

I have a script in /scripts/ which is where I keep my scripts. Individually, every command works. It is a simple script containing:

chown -R --reference=/data/<path1>/<file> /data/<path1>/<file_name>

mv /data/<path1>/<file_name> /data/<path2>/<file_name>_$(date +%F-%H:%M)


But I can not get it to run or can not get it to run successfully in crontab:
15 07 * * 1,6,7 /scripts/name_of_script.sh
or
15 07 * * Mon,Sat,Sun /scripts/name_of_script.sh

Can anybody tell me if there is something wring with my crontab entry (either format) or something else that would stop it running?

  • Who is the owner of the script (should be admin, not root, I believe) and did you set the execute bit on it?

2 Replies

Replies have been turned off for this discussion
  • Sandshark's avatar
    Sandshark
    Sensei - Experienced User

    Who is the owner of the script (should be admin, not root, I believe) and did you set the execute bit on it?

    • davidr1's avatar
      davidr1
      Luminary

      Many thanks Sandshank - that was the problem.

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More