5

I put my shell script inside /etc/cron.daily

I was hoping everything that in that folder would be run daily but my script is not being ran.

physiii
  • 211
  • What is the name of your script? Does it conform to the conventions listed in the DEBIAN SPECIFIC section of the cron manpage? – steeldriver Nov 16 '16 at 23:38
  • 2
    solved the problem by adding #! /bin/bash to line 1 and renaming sync.sh to sync -- don't know how to answer my own question on here. – physiii Nov 17 '16 at 15:15

1 Answers1

10

Keep in mind that scripts installed in /etc/cron.{hourly|daily|weekly|monthly} must be executable, for run-parts to process them.


Update: Indeed, defining the shebang is also mandatory in cron scripts for run-parts to process them. And as a general rule: you should always set one.

SYN
  • 2,831
  • Okay, I ran sudo chmod +x /etc/cron.daily/sync.sh -- we'll see if that works. All that's in the script is: sh /home/physiii/sync.sh >> /var/log/sync 2>&1 & – physiii Nov 17 '16 at 14:31
  • 2
    solved the problem by adding #! /bin/bash to line 1 and renaming sync.sh to sync -- don't know how to answer my own question on here. – physiii Nov 17 '16 at 15:14